diff options
author | Scott González <scott.gonzalez@gmail.com> | 2015-01-05 15:44:49 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2015-02-09 11:56:15 -0500 |
commit | dc2b17d62f77e6f9795eecdebb0d37603ffd285b (patch) | |
tree | e35cb1ab0c03dfbd9bb292f76d268ee5905d3967 /ui | |
parent | 727a9151d207ea6cc78afb18003618648495b621 (diff) | |
download | jquery-ui-dc2b17d62f77e6f9795eecdebb0d37603ffd285b.tar.gz jquery-ui-dc2b17d62f77e6f9795eecdebb0d37603ffd285b.zip |
Accordion: Set `aria-expanded` when collapsing
Fixes #10703
Closes gh-1413
(cherry picked from commit ab798cb4646cfeb79f1949eb70cd64813a248d87)
Diffstat (limited to 'ui')
-rw-r--r-- | ui/accordion.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/accordion.js b/ui/accordion.js index ac8b74d95..46f7e8509 100644 --- a/ui/accordion.js +++ b/ui/accordion.js @@ -483,7 +483,10 @@ return $.widget( "ui.accordion", { toHide.attr({ "aria-hidden": "true" }); - toHide.prev().attr( "aria-selected", "false" ); + toHide.prev().attr({ + "aria-selected": "false", + "aria-expanded": "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 @@ -494,7 +497,7 @@ return $.widget( "ui.accordion", { }); } else if ( toShow.length ) { this.headers.filter(function() { - return $( this ).attr( "tabIndex" ) === 0; + return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0; }) .attr( "tabIndex", -1 ); } @@ -504,8 +507,8 @@ return $.widget( "ui.accordion", { .prev() .attr({ "aria-selected": "true", - tabIndex: 0, - "aria-expanded": "true" + "aria-expanded": "true", + tabIndex: 0 }); }, |