From 690bbee3f0798ba944111f46d10f540803b7f224 Mon Sep 17 00:00:00 2001 From: hannes Date: Mon, 15 Oct 2012 16:46:16 +0800 Subject: [PATCH] attempt to fix eventPropagation issue when toogle --- ui/jquery.ui.selectmenu.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index ef0a11eea..8ff847b59 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -90,10 +90,11 @@ $.widget("ui.selectmenu", { self._safemouseup = false; setTimeout(function() { self._safemouseup = true; }, 300); } - return false; + + event.preventDefault(); }) .bind('click.selectmenu', function() { - return false; + event.preventDefault(); }) .bind("keydown.selectmenu", function(event) { var ret = false; @@ -161,7 +162,8 @@ $.widget("ui.selectmenu", { // document click closes menu $(document).bind("mousedown.selectmenu-" + this.ids[0], function(event) { - if ( self.isOpen ) { + //check if open and if the clicket targes parent is the same + if ( self.isOpen && self.ids[1] != event.target.offsetParent.id) { self.close( event ); } }); @@ -869,4 +871,4 @@ $.widget("ui.selectmenu", { } }); -})(jQuery); +})(jQuery); \ No newline at end of file -- 2.39.5