File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
plugins/postcss-focus-within Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,11 @@ export default function focusWithin(opts) {
6565 const handleFocusChange = generateHandler ( options . replaceWith ) ;
6666
6767 const initialize = function initializeEventListeners ( ) {
68- document . documentElement . classList . add ( 'js-focus-within' ) ;
68+ if ( document . documentElement . className . indexOf ( 'js-focus-within' ) > - 1 ) {
69+ return ;
70+ }
71+
72+ document . documentElement . className = document . documentElement . className + ' js-focus-within' ;
6973 document . addEventListener ( 'focus' , handleFocusChange , true ) ;
7074 document . addEventListener ( 'blur' , handleFocusChange , true ) ;
7175 } ;
Original file line number Diff line number Diff line change 77 < link rel ="stylesheet " href ="/test/browser.expect.css ">
88 < script src ="/dist/browser-global.js "> </ script >
99 < script > self . _focusWithinInit = focusWithinInit </ script >
10+ < script > self . _focusWithinInit ( ) </ script >
1011</ head >
1112< body >
1213 < div id ="a-grand-parent ">
You can’t perform that action at this time.
0 commit comments