Selectmenu: use item.index instead of _getSelectedItem method

This commit is contained in:
Felix Nagel 2012-12-03 23:19:15 +01:00
parent 40b8567526
commit aa60a9e114

View File

@ -389,7 +389,7 @@ $.widget( "ui.selectmenu", {
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.menuItems.eq( item.index ).find( "a" ).attr( "aria-selected", true );
this.button.attr( "aria-labelledby", this.menuItems.eq( item.index ).find( "a" ).attr( "id" ) );
},