mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
🐛 make picture card tabbable only if action set (#4494)
* 🐛 make picture card tabbable only if action set * 👌use ifDefined and hasAction * ✏️ fix syntax mistake
This commit is contained in:
parent
eb9023595d
commit
67022b9ffc
@ -20,6 +20,7 @@ import { actionHandler } from "../common/directives/action-handler-directive";
|
||||
import { hasAction } from "../common/has-action";
|
||||
import { ActionHandlerEvent } from "../../../data/lovelace";
|
||||
import { handleAction } from "../common/handle-action";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
|
||||
@customElement("hui-picture-card")
|
||||
export class HuiPictureCard extends LitElement implements LovelaceCard {
|
||||
@ -86,10 +87,14 @@ export class HuiPictureCard extends LitElement implements LovelaceCard {
|
||||
hasHold: hasAction(this._config!.hold_action),
|
||||
hasDoubleClick: hasAction(this._config!.double_tap_action),
|
||||
})}
|
||||
tabindex="0"
|
||||
tabindex=${ifDefined(
|
||||
hasAction(this._config.tap_action) ? "0" : undefined
|
||||
)}
|
||||
class="${classMap({
|
||||
clickable: Boolean(
|
||||
this._config.tap_action || this._config.hold_action
|
||||
this._config.tap_action ||
|
||||
this._config.hold_action ||
|
||||
this._config.double_tap_action
|
||||
),
|
||||
})}"
|
||||
>
|
||||
|
Loading…
x
Reference in New Issue
Block a user