Skip to content

Commit 123402c

Browse files
committed
Keep track of active page when 'touchend' event happens and compare it to the active page when 'click' event happens
1 parent ea11dfb commit 123402c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

js/jquery.mobile.vmouse.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ function handleTouchEnd( event ) {
272272
t = getNativeEvent( event ).changedTouches[ 0 ];
273273
clickBlockList.push({
274274
touchID: lastTouchID,
275+
parentPage: $( event.target ).closest( ":jqmData(role='page')" ),
275276
x: t.clientX,
276277
y: t.clientY
277278
});
@@ -466,8 +467,10 @@ if ( eventCaptureSupported ) {
466467
o = clickBlockList[ i ];
467468
touchID = 0;
468469

469-
if ( ( ele === target && Math.abs( o.x - x ) < threshold && Math.abs( o.y - y ) < threshold ) ||
470-
$.data( ele, touchTargetPropertyName ) === o.touchID ) {
470+
if ( clickBlockList[i].parentPage.get(0) != $.mobile.activePage.get(0)
471+
|| ( ele === target && Math.abs( o.x - x ) < threshold && Math.abs( o.y - y ) < threshold )
472+
|| $.data( ele, touchTargetPropertyName ) === o.touchID ) {
473+
471474
// XXX: We may want to consider removing matches from the block list
472475
// instead of waiting for the reset timer to fire.
473476
e.preventDefault();

0 commit comments

Comments
 (0)