File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1145,15 +1145,15 @@ value. Add CSS units to its value to avoid breaking the slides layout.`);
11451145 let isSlideInView ;
11461146 this . _slides . map ( slide => slide . element ) . forEach ( ( slideEl , slideIndex ) => {
11471147 isSlideInView = ! isUndefined ( slidesInView . find ( i => i === slideIndex ) ) ;
1148- // Slides in view have `aria-hidden` set to `false`.
1148+
1149+ // Ensure DOM is not accessible unless it is in the view.
1150+ slideEl . inert = ! isSlideInView ;
11491151 slideEl . setAttribute ( ATTRS . STANDARD . ARIA . HIDDEN ,
11501152 isSlideInView ? ATTR_VALUES . FALSE : ATTR_VALUES . TRUE ) ;
1153+
11511154 // Slides in view don't have the `inert` attribute and can be focused.
11521155 if ( isSlideInView ) {
1153- slideEl . removeAttribute ( ATTRS . STANDARD . INERT ) ;
1154- slideEl . setAttribute ( ATTRS . STANDARD . TABINDEX , - 1 ) ;
1155- } else {
1156- slideEl . setAttribute ( ATTRS . STANDARD . INERT , '' ) ;
1156+ slideEl . setAttribute ( ATTRS . STANDARD . TABINDEX , '-1' ) ;
11571157 }
11581158 } ) ;
11591159 }
You can’t perform that action at this time.
0 commit comments