mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Menu: If the active element no longer exists after a refresh, blur the menu.
This commit is contained in:
parent
b22e3c36f2
commit
93556a8e18
2
ui/jquery.ui.autocomplete.js
vendored
2
ui/jquery.ui.autocomplete.js
vendored
@ -482,8 +482,6 @@ $.widget( "ui.autocomplete", {
|
||||
.empty()
|
||||
.zIndex( this.element.zIndex() + 1 );
|
||||
this._renderMenu( ul, items );
|
||||
// TODO refresh should check if the active item is still in the dom, removing the need for a manual blur
|
||||
this.menu.blur();
|
||||
this.menu.refresh();
|
||||
|
||||
// size and position menu
|
||||
|
5
ui/jquery.ui.menu.js
vendored
5
ui/jquery.ui.menu.js
vendored
@ -319,6 +319,11 @@ $.widget( "ui.menu", {
|
||||
.prepend( submenuCarat );
|
||||
menu.attr( "aria-labelledby", item.attr( "id" ) );
|
||||
});
|
||||
|
||||
// If the active item has been removed, blur the menu
|
||||
if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
|
||||
this.blur();
|
||||
}
|
||||
},
|
||||
|
||||
_itemRole: function() {
|
||||
|
Loading…
Reference in New Issue
Block a user