Skip to content

Commit

Permalink
re-enable touchEvent handling
Browse files Browse the repository at this point in the history
  • Loading branch information
biodiv committed Sep 14, 2022
2 parents e18c777 + 15d1a1b commit b1fbb27
Show file tree
Hide file tree
Showing 6 changed files with 1,583 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "contactjs",
"version": "2.0",
"version": "2.0.3",
"description": "Pointer gestures for your webapp",
"main": "dist/index.js",
"module": "dist/contact.js",
Expand Down
4 changes: 3 additions & 1 deletion src/PointerListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ export class PointerListener {

const onTouchMove = this.onTouchMove.bind(this);

this.domElement.addEventListener("touchmove", onTouchMove, { passive: true });
// do NOT make the touchmove listener passive, as this listener might block touch events from
// interfering with pan/swipe. Passive listeners make the promise not to block scrolling.
this.domElement.addEventListener("touchmove", onTouchMove);

this.touchEventHandlers["touchmove"] = onTouchMove;

Expand Down
4 changes: 2 additions & 2 deletions src/gestures/Pan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export class Pan extends SinglePointerGesture {
console.log("[Pan] preventing touchmove default");
}

//event.preventDefault();
//event.stopPropagation();
event.preventDefault();
event.stopPropagation();
}
}
}
Binary file added tests/contact-test-nomodule.zip
Binary file not shown.
Loading

0 comments on commit b1fbb27

Please sign in to comment.