File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -453,16 +453,23 @@ $.widget( "ui.accordion", {
453
453
this . _toggleComplete ( data ) ;
454
454
}
455
455
456
- toHide
457
- . attr ( {
458
- "aria-expanded" : "false" ,
459
- "aria-hidden" : "true"
456
+ toHide . attr ( {
457
+ "aria-expanded" : "false" ,
458
+ "aria-hidden" : "true"
459
+ } ) ;
460
+ toHide . prev ( ) . attr ( "aria-selected" , "false" ) ;
461
+ // if we're switching panels, remove the old header from the tab order
462
+ // if we're opening from collapsed state, remove the previous header from the tab order
463
+ // if we're collapsing, then keep the collapsing header in the tab order
464
+ if ( toShow . length && toHide . length ) {
465
+ toHide . prev ( ) . attr ( "tabIndex" , - 1 ) ;
466
+ } else if ( toShow . length ) {
467
+ this . headers . filter ( function ( ) {
468
+ return $ ( this ) . attr ( "tabIndex" ) === 0 ;
460
469
} )
461
- . prev ( )
462
- . attr ( {
463
- "aria-selected" : "false" ,
464
- tabIndex : - 1
465
- } ) ;
470
+ . attr ( "tabIndex" , - 1 ) ;
471
+ }
472
+
466
473
toShow
467
474
. attr ( {
468
475
"aria-expanded" : "true" ,
You can’t perform that action at this time.
0 commit comments