Skip to content

Commit

Permalink
Fix back gesture on Android activating buttons (#22852)
Browse files Browse the repository at this point in the history
Touchcancel event cancels touch regardless of cancelled flag

Co-authored-by: Benjamin Paul <[email protected]>
  • Loading branch information
mattyway and Ongion authored Nov 17, 2024
1 parent fa821b1 commit 1f5f6c5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ class ActionHandler extends HTMLElement implements ActionHandlerType {

element.actionHandler.end = (ev: Event) => {
// Don't respond when moved or scrolled while touch
if (["touchend", "touchcancel"].includes(ev.type) && this.cancelled) {
if (
ev.type === "touchcancel" ||
(ev.type === "touchend" && this.cancelled)
) {
return;
}
const target = ev.target as HTMLElement;
Expand Down

0 comments on commit 1f5f6c5

Please sign in to comment.