mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Fix tap firing twice on iOS (#4841)
This commit is contained in:
parent
50d0671abe
commit
97a6354a72
@ -138,7 +138,10 @@ class HuiEntityButtonCard extends LitElement implements LovelaceCard {
|
|||||||
hasDoubleClick: hasAction(this._config!.double_tap_action),
|
hasDoubleClick: hasAction(this._config!.double_tap_action),
|
||||||
})}
|
})}
|
||||||
tabindex=${ifDefined(
|
tabindex=${ifDefined(
|
||||||
hasAction(this._config.tap_action) ? "0" : undefined
|
hasAction(this._config.tap_action) ||
|
||||||
|
this._config.tap_action === undefined
|
||||||
|
? "0"
|
||||||
|
: undefined
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
${this._config.show_icon
|
${this._config.show_icon
|
||||||
@ -203,7 +206,6 @@ class HuiEntityButtonCard extends LitElement implements LovelaceCard {
|
|||||||
|
|
||||||
ha-card:focus {
|
ha-card:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
background: var(--divider-color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-icon {
|
ha-icon {
|
||||||
|
@ -177,7 +177,7 @@ class ActionHandler extends HTMLElement implements ActionHandler {
|
|||||||
} else {
|
} else {
|
||||||
fireEvent(element, "action", { action: "tap" });
|
fireEvent(element, "action", { action: "tap" });
|
||||||
}
|
}
|
||||||
window.setTimeout(() => (this.touch = undefined), 100);
|
window.setTimeout(() => (this.touch = undefined), this.holdTime);
|
||||||
};
|
};
|
||||||
|
|
||||||
element.addEventListener("touchstart", touchStart, { passive: true });
|
element.addEventListener("touchstart", touchStart, { passive: true });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user