From 027d8d4cab27b89d3b1b137fbb8ce81c9fdafc54 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Tue, 29 Oct 2013 20:54:16 +0100 Subject: [PATCH] Selectmenu: close menu on other element mousedown not on click --- tests/unit/selectmenu/selectmenu_events.js | 2 +- ui/jquery.ui.selectmenu.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/selectmenu/selectmenu_events.js b/tests/unit/selectmenu/selectmenu_events.js index 182c0cd1b..2c10b4c87 100644 --- a/tests/unit/selectmenu/selectmenu_events.js +++ b/tests/unit/selectmenu/selectmenu_events.js @@ -49,7 +49,7 @@ test( "close", function () { this.element.selectmenu( "open" ).selectmenu( "close" ); this.element.selectmenu( "open" ); - $( "body" ).trigger( "click" ); + $( "body" ).trigger( "mousedown" ); }); diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 69f863108..5c13a1619 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -321,7 +321,7 @@ $.widget( "ui.selectmenu", { }, _documentClick: { - click: function( event ) { + mousedown: function( event ) { if ( this.isOpen && !$( event.target ).closest( "li.ui-state-disabled, li.ui-selectmenu-optgroup, #" + this.ids.button ).length ) { this.close( event ); } -- 2.39.5