mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 02:49:51 +00:00
Fix pointer cursor issues (#21587)
* Fix pointer cursor issues * one more
This commit is contained in:
@@ -20,7 +20,7 @@ import { HomeAssistant } from "../../../types";
|
||||
import { EntitiesCardEntityConfig } from "../cards/types";
|
||||
import { actionHandler } from "../common/directives/action-handler-directive";
|
||||
import { handleAction } from "../common/handle-action";
|
||||
import { hasAction } from "../common/has-action";
|
||||
import { hasAction, hasAnyAction } from "../common/has-action";
|
||||
import { createEntityNotFoundWarning } from "./hui-warning";
|
||||
|
||||
@customElement("hui-generic-entity-row")
|
||||
@@ -60,9 +60,7 @@ export class HuiGenericEntityRow extends LitElement {
|
||||
// By default, we always show a pointer, since if there is no explicit configuration provided,
|
||||
// the frontend always assumes "more-info" in the action handler. We only need to hide the pointer
|
||||
// if the tap action is explicitly set to "none".
|
||||
const pointer = !(
|
||||
this.config.tap_action && this.config.tap_action.action === "none"
|
||||
);
|
||||
const pointer = hasAnyAction(this.config);
|
||||
|
||||
const hasSecondary = this.secondaryText || this.config.secondary_info;
|
||||
const name = this.config.name ?? computeStateName(stateObj);
|
||||
@@ -82,7 +80,11 @@ export class HuiGenericEntityRow extends LitElement {
|
||||
hasHold: hasAction(this.config!.hold_action),
|
||||
hasDoubleClick: hasAction(this.config!.double_tap_action),
|
||||
})}
|
||||
tabindex=${ifDefined(pointer ? "0" : undefined)}
|
||||
tabindex=${ifDefined(
|
||||
!this.config.tap_action || hasAction(this.config.tap_action)
|
||||
? "0"
|
||||
: undefined
|
||||
)}
|
||||
></state-badge>
|
||||
${!this.hideName
|
||||
? html`<div
|
||||
|
||||
Reference in New Issue
Block a user