From 6759afff6697fcbefaa3f0facdc80d3cec450547 Mon Sep 17 00:00:00 2001 From: Kin Blas Date: Thu, 1 Sep 2011 14:17:10 -0700 Subject: [PATCH] Fix for issue 1925 - Single tap triggers two actions, especially in android B1 - Trigger the list item and keyboard return/space key up to the "click" event instead of "vclick". This delays the dismissal of the custom select menu until the click event, thereby avoiding the case where the menu disappears before the browser dispatches it's synthesized mouse events (in the touch case) with a target of whatever element was underneath the menu. --- js/jquery.mobile.forms.select.custom.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/jquery.mobile.forms.select.custom.js b/js/jquery.mobile.forms.select.custom.js index d62e1f1f..d94c8994 100644 --- a/js/jquery.mobile.forms.select.custom.js +++ b/js/jquery.mobile.forms.select.custom.js @@ -103,7 +103,7 @@ .delegate( ".ui-li>a", "focusout", function() { $( this ).attr( "tabindex", "-1" ); }) - .delegate( "li:not(.ui-disabled, .ui-li-divider)", "vclick", function( event ) { + .delegate( "li:not(.ui-disabled, .ui-li-divider)", "click", function( event ) { // index of option tag to be selected var oldIndex = self.select[ 0 ].selectedIndex, @@ -174,7 +174,7 @@ // If enter or space is pressed, trigger click case 13: case 32: - target.trigger( "vclick" ); + target.trigger( "click" ); return false; break;