enter is registering as double_tap (#4161)

* enter is registering as double_tap

* Update long-press-directive.ts

* Update long-press-directive.ts
This commit is contained in:
Ian Richardson 2019-11-01 10:39:53 -05:00 committed by Bram Kragten
parent f53eea81c4
commit e37201f84f

View File

@ -123,7 +123,7 @@ class LongPress extends HTMLElement implements LongPress {
if (this.held) {
element.dispatchEvent(new Event("ha-hold"));
} else if (options.hasDoubleClick) {
if ((ev as MouseEvent).detail === 1) {
if ((ev as MouseEvent).detail === 1 || ev.type === "keyup") {
this.dblClickTimeout = window.setTimeout(() => {
element.dispatchEvent(new Event("ha-click"));
}, 250);