From 1f5f6c5f8ab9990be1a7787ef06f23b5b07639f8 Mon Sep 17 00:00:00 2001 From: Matt Way Date: Mon, 18 Nov 2024 03:55:43 +1100 Subject: [PATCH] Fix back gesture on Android activating buttons (#22852) Touchcancel event cancels touch regardless of cancelled flag Co-authored-by: Benjamin Paul --- .../lovelace/common/directives/action-handler-directive.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/panels/lovelace/common/directives/action-handler-directive.ts b/src/panels/lovelace/common/directives/action-handler-directive.ts index d39db84b6b..ef931d895b 100644 --- a/src/panels/lovelace/common/directives/action-handler-directive.ts +++ b/src/panels/lovelace/common/directives/action-handler-directive.ts @@ -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;