mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Selectmenu: improved event handling, fixed anchor problem when clicking menu item
This commit is contained in:
parent
2be6e70bba
commit
ee26baa997
11
ui/jquery.ui.selectmenu.js
vendored
11
ui/jquery.ui.selectmenu.js
vendored
@ -144,7 +144,10 @@ $.widget( "ui.selectmenu", {
|
||||
|
||||
if ( flag ) that._trigger( "change", event, { item: item } );
|
||||
|
||||
that.close( event, true);
|
||||
if ( that.opened ) {
|
||||
event.preventDefault();
|
||||
that.close( event, true);
|
||||
}
|
||||
},
|
||||
focus: function( event, ui ) {
|
||||
var item = ui.item.data( "item.selectmenu" );
|
||||
@ -152,12 +155,6 @@ $.widget( "ui.selectmenu", {
|
||||
that.focus = item.index;
|
||||
}
|
||||
});
|
||||
|
||||
that._bind( that.list, {
|
||||
'click': function( event ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
// document click closes menu
|
||||
that._bind( document, {
|
||||
|
Loading…
Reference in New Issue
Block a user