From 228a9b91fb1a90490a7a1f71dee89a920efa1b5e Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Fri, 26 Oct 2012 00:41:17 +0200 Subject: [PATCH] Selectmenu: follow-up for menu, reset aria-activedescendant to selected item when menu is closed --- ui/jquery.ui.selectmenu.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 54e478a1b..6b353d8db 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -230,9 +230,11 @@ $.widget( "ui.selectmenu", { close: function( event ) { if ( this.isOpen ) { + var id = this._getSelectedItem().find( "a" ).attr( "id" ); this.isOpen = false; this._toggleAttr(); - this.button.attr( "aria-activedescendant", this._getSelectedItem().find( "a" ).attr( "id" ) ); + this.button.attr( "aria-activedescendant", id ); + this.menu.attr( "aria-activedescendant", id ); this._trigger( "close", event ); } },