Skip to content
Permalink
Browse files

Selectmenu: improved event handling, fixed anchor problem when clicki…

…ng menu item
  • Loading branch information...
fnagel committed Oct 10, 2011
1 parent 2be6e70 commit ee26baa997710ea870ab27f6d00b4efd01809859
Showing with 4 additions and 7 deletions.
  1. +4 −7 ui/jquery.ui.selectmenu.js
@@ -144,20 +144,17 @@ $.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" );
if ( that.focus !== undefined && item.index != that.focus ) that._trigger( "focus", event, { item: item } );
that.focus = item.index;
}
});

that._bind( that.list, {
'click': function( event ) {
event.preventDefault();
}
});

// document click closes menu
that._bind( document, {

0 comments on commit ee26baa

Please sign in to comment.
You can’t perform that action at this time.