File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 1818const focusableSelector = '[tabindex], a, input, button' ;
1919const containerSelector = 'nav, section, .lrud-container' ;
2020const focusableContainerSelector = '[data-lrud-consider-container-distance]' ;
21- const ignoredClass = 'lrud-ignore' ;
21+ const ignoreSelector = '. lrud-ignore, [disabled], [aria-disabled="true"] ' ;
2222
2323/**
2424 * Element API .matches() with fallbacks
@@ -75,13 +75,11 @@ const getParentContainer = (elem) => {
7575const getFocusables = ( scope ) => {
7676 if ( ! scope ) return [ ] ;
7777
78- const ignoredElements = toArray ( scope . querySelectorAll ( '.' + ignoredClass ) ) ;
79- if ( scope . className . indexOf ( ignoredClass ) > - 1 ) ignoredElements . push ( scope ) ;
78+ const ignoredElements = toArray ( scope . querySelectorAll ( ignoreSelector ) ) ;
79+ if ( scope . className . indexOf ( ignoreSelector ) > - 1 ) ignoredElements . push ( scope ) ;
8080
8181 return toArray ( scope . querySelectorAll ( focusableSelector ) )
8282 . filter ( node => ! ignoredElements . some ( ignored => ignored == node || ignored . contains ( node ) ) )
83- . filter ( node => node . getAttribute ( 'disabled' ) == null )
84- . filter ( node => ! ( node . getAttribute ( 'aria-disabled' ) == 'true' ) )
8583 . filter ( node => parseInt ( node . getAttribute ( 'tabindex' ) || '0' , 10 ) > - 1 ) ;
8684} ;
8785
You can’t perform that action at this time.
0 commit comments