mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Accordion: Make sure there's always one header with tabindex=0. Fixes #8348 - Accordion: Collapsed accordion is removed from tab order.
This commit is contained in:
parent
1af21ce27d
commit
6a48cda458
25
ui/jquery.ui.accordion.js
vendored
25
ui/jquery.ui.accordion.js
vendored
@ -453,16 +453,23 @@ $.widget( "ui.accordion", {
|
|||||||
this._toggleComplete( data );
|
this._toggleComplete( data );
|
||||||
}
|
}
|
||||||
|
|
||||||
toHide
|
toHide.attr({
|
||||||
.attr({
|
"aria-expanded": "false",
|
||||||
"aria-expanded": "false",
|
"aria-hidden": "true"
|
||||||
"aria-hidden": "true"
|
});
|
||||||
|
toHide.prev().attr( "aria-selected", "false" );
|
||||||
|
// if we're switching panels, remove the old header from the tab order
|
||||||
|
// if we're opening from collapsed state, remove the previous header from the tab order
|
||||||
|
// if we're collapsing, then keep the collapsing header in the tab order
|
||||||
|
if ( toShow.length && toHide.length ) {
|
||||||
|
toHide.prev().attr( "tabIndex", -1 );
|
||||||
|
} else if ( toShow.length ) {
|
||||||
|
this.headers.filter(function() {
|
||||||
|
return $( this ).attr( "tabIndex" ) === 0;
|
||||||
})
|
})
|
||||||
.prev()
|
.attr( "tabIndex", -1 );
|
||||||
.attr({
|
}
|
||||||
"aria-selected": "false",
|
|
||||||
tabIndex: -1
|
|
||||||
});
|
|
||||||
toShow
|
toShow
|
||||||
.attr({
|
.attr({
|
||||||
"aria-expanded": "true",
|
"aria-expanded": "true",
|
||||||
|
Loading…
Reference in New Issue
Block a user