Fix back gesture on Android activating buttons (#22852)

Touchcancel event cancels touch regardless of cancelled flag

Co-authored-by: Benjamin Paul <benjamin.ian.paul@gmail.com>
This commit is contained in:
Matt Way 2024-11-18 03:55:43 +11:00 committed by GitHub
parent fa821b1c4f
commit 1f5f6c5f8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;