From 1997e63b7cbca601d38f6329255aaaefd135e269 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 3 Sep 2020 14:09:25 +0200 Subject: [PATCH] Fix action handler for touch (#6775) * Fix action handler for touch * Console --- .../common/directives/action-handler-directive.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/panels/lovelace/common/directives/action-handler-directive.ts b/src/panels/lovelace/common/directives/action-handler-directive.ts index 1a837b5743..09dc3c4351 100644 --- a/src/panels/lovelace/common/directives/action-handler-directive.ts +++ b/src/panels/lovelace/common/directives/action-handler-directive.ts @@ -150,13 +150,13 @@ class ActionHandler extends HTMLElement implements ActionHandler { } // Prevent mouse event if touch event ev.preventDefault(); - if ( - ["touchend", "touchcancel"].includes(ev.type) && - this.timer === undefined - ) { - return; - } if (options.hasHold) { + if ( + ["touchend", "touchcancel"].includes(ev.type) && + this.timer === undefined + ) { + return; + } clearTimeout(this.timer); this.stopAnimation(); this.timer = undefined;