From ee26baa997710ea870ab27f6d00b4efd01809859 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Mon, 10 Oct 2011 20:27:29 +0200 Subject: [PATCH] Selectmenu: improved event handling, fixed anchor problem when clicking menu item --- ui/jquery.ui.selectmenu.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 113c53e31..15019945f 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -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, {