diff options
author | Felix Nagel <info@felixnagel.com> | 2012-10-26 00:33:20 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2012-10-26 00:33:20 +0200 |
commit | a59b3c75851429c22bd87c0992b43da5e386230e (patch) | |
tree | 84305d47c91937169bf4b096ed94f0a6d12c75f4 /ui/jquery.ui.selectmenu.js | |
parent | 7c1a9d9a365873a61471fbb4f7a7f6d43e66088a (diff) | |
download | jquery-ui-a59b3c75851429c22bd87c0992b43da5e386230e.tar.gz jquery-ui-a59b3c75851429c22bd87c0992b43da5e386230e.zip |
Selectmenu: reset aria-activedescendant to selected item when menu is closed
Diffstat (limited to 'ui/jquery.ui.selectmenu.js')
-rw-r--r-- | ui/jquery.ui.selectmenu.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 1deba4a36..54e478a1b 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -155,7 +155,6 @@ $.widget( "ui.selectmenu", { // Set ARIA active decendent that.button.attr( "aria-activedescendant", that.menuItems.eq( item.index ).find( "a" ).attr( "id" ) ); - }, // set ARIA role role: 'listbox' @@ -233,6 +232,7 @@ $.widget( "ui.selectmenu", { if ( this.isOpen ) { this.isOpen = false; this._toggleAttr(); + this.button.attr( "aria-activedescendant", this._getSelectedItem().find( "a" ).attr( "id" ) ); this._trigger( "close", event ); } }, @@ -376,16 +376,12 @@ $.widget( "ui.selectmenu", { }, _setSelected: function( item ) { - var itemId = this.menuItems.eq( item.index ).find( "a" ).attr( "id" ); // update button text this.buttonText.html( item.label ); // change ARIA attr this.menuItems.find( "a" ).attr( "aria-selected", false ); this._getSelectedItem().find( "a" ).attr( "aria-selected", true ); - this.button.attr({ - "aria-activedescendant": itemId, - "aria-labelledby": itemId - }); + this.button.attr( "aria-labelledby", this.menuItems.eq( item.index ).find( "a" ).attr( "id" ) ); }, _setOption: function( key, value ) { |