mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Selectmenu: fix closing of empty selects
This commit is contained in:
parent
c69d01bed7
commit
1ea22565d3
11
ui/jquery.ui.selectmenu.js
vendored
11
ui/jquery.ui.selectmenu.js
vendored
@ -222,11 +222,16 @@ $.widget( "ui.selectmenu", {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var id = this._getSelectedItem().find( "a" ).attr( "id" );
|
|
||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
this._toggleAttr();
|
this._toggleAttr();
|
||||||
this.button.attr( "aria-activedescendant", id );
|
|
||||||
this.menu.attr( "aria-activedescendant", id );
|
// check if we have an item to select
|
||||||
|
if ( this.menuItems ) {
|
||||||
|
var id = this._getSelectedItem().find( "a" ).attr( "id" );
|
||||||
|
this.button.attr( "aria-activedescendant", id );
|
||||||
|
this.menu.attr( "aria-activedescendant", id );
|
||||||
|
}
|
||||||
|
|
||||||
this._trigger( "close", event );
|
this._trigger( "close", event );
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user