diff --git a/src/components/ha-control-number-buttons.ts b/src/components/ha-control-number-buttons.ts index 95c16f5fa2..324444256e 100644 --- a/src/components/ha-control-number-buttons.ts +++ b/src/components/ha-control-number-buttons.ts @@ -81,6 +81,7 @@ export class HaControlNumberButton extends LitElement { } _handleKeyDown(e: KeyboardEvent) { + if (this.disabled) return; if (!A11Y_KEY_CODES.has(e.code)) return; e.preventDefault(); switch (e.code) { @@ -116,7 +117,7 @@ export class HaControlNumberButton extends LitElement { const displayedValue = this.value != null ? formatNumber(this.value, this.locale, this.formatOptions) - : "-"; + : ""; return html`
@@ -124,12 +125,12 @@ export class HaControlNumberButton extends LitElement { id="input" class="value" role="number-button" - tabindex="0" + .tabIndex=${this.disabled ? "-1" : "0"} aria-valuenow=${this.value} aria-valuemin=${this.min} aria-valuemax=${this.max} aria-label=${ifDefined(this.label)} - .disabled=${this.disabled} + ?disabled=${this.disabled} @keydown=${this._handleKeyDown} > ${displayedValue} @@ -240,6 +241,7 @@ export class HaControlNumberButton extends LitElement { .button[disabled] { opacity: 0.4; pointer-events: none; + cursor: not-allowed; } .button.minus { left: 0; diff --git a/src/components/ha-control-select.ts b/src/components/ha-control-select.ts index 855fc338a1..04ff1f9f2c 100644 --- a/src/components/ha-control-select.ts +++ b/src/components/ha-control-select.ts @@ -217,6 +217,7 @@ export class HaControlSelect extends LitElement { transition: box-shadow 180ms ease-in-out; font-style: normal; font-weight: 500; + color: var(--primary-text-color); user-select: none; -webkit-tap-highlight-color: transparent; } @@ -267,7 +268,6 @@ export class HaControlSelect extends LitElement { justify-content: center; border-radius: var(--control-select-button-border-radius); overflow: hidden; - color: var(--primary-text-color); /* For safari border-radius overflow */ z-index: 0; } @@ -331,6 +331,7 @@ export class HaControlSelect extends LitElement { :host([disabled]) { --control-select-color: var(--disabled-color); --control-select-focused-opacity: 0; + color: var(--disabled-color); } :host([disabled]) .option { cursor: not-allowed;