From 2a23487163e1d489e812e634633be8b8aaa54de1 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 9 Dec 2018 10:09:34 +0100 Subject: [PATCH] Fix long press in FF (#2226) * Fix long press in FF * Better fix --- src/panels/lovelace/common/directives/long-press-directive.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panels/lovelace/common/directives/long-press-directive.ts b/src/panels/lovelace/common/directives/long-press-directive.ts index 718ccbafab..879a0f3089 100644 --- a/src/panels/lovelace/common/directives/long-press-directive.ts +++ b/src/panels/lovelace/common/directives/long-press-directive.ts @@ -110,7 +110,8 @@ class LongPress extends HTMLElement implements LongPress { const clickEnd = (ev: Event) => { if ( this.cooldownEnd || - (ev instanceof TouchEvent && this.timer === undefined) + (["touchend", "touchcancel"].includes(ev.type) && + this.timer === undefined) ) { return; }