Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Fix for issue 1925 - Single tap triggers two actions, especially in a…
Browse files Browse the repository at this point in the history
…ndroid 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.
  • Loading branch information
jblas committed Sep 1, 2011
1 parent df8d6fa commit 6759aff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/jquery.mobile.forms.select.custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6759aff

Please sign in to comment.