Skip to content

Commit ebbbb31

Browse files
OngionRomRider
authored andcommitted
fix: Don't trigger action on touchcancel event (#808)
When using the Android Navigation Back Gesture (swipe from side of screen), tap actions are still triggered even though Android sent a touchcancel event. This changes makes it so that a touchcancel event does not trigger actions. Fixes #914
1 parent 8e34b84 commit ebbbb31

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/action-handler.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ class ActionHandler extends HTMLElement implements ActionHandler {
179179
}
180180
return;
181181
}
182+
183+
// Don't do anything else if touch event was cancelled
184+
if (ev.type == 'touchcancel') {
185+
return;
186+
}
187+
182188
const target = ev.target as HTMLElement;
183189
// Prevent mouse event if touch event
184190
if (ev.cancelable) {

0 commit comments

Comments
 (0)