mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Focus alarm control panel PIN input on wider screens (#24324)
* Focus alarm control panel PIN input on wider screens * Also apply on textfield
This commit is contained in:
parent
f84ad92356
commit
cae36b393b
@ -40,8 +40,13 @@ export class DialogEnterCode
|
||||
|
||||
@state() private _showClearButton = false;
|
||||
|
||||
@state() private _narrow = false;
|
||||
|
||||
public async showDialog(dialogParams: EnterCodeDialogParams): Promise<void> {
|
||||
this._dialogParams = dialogParams;
|
||||
this._narrow = matchMedia(
|
||||
"all and (max-width: 450px), all and (max-height: 500px)"
|
||||
).matches;
|
||||
await this.updateComplete;
|
||||
}
|
||||
|
||||
@ -96,7 +101,7 @@ export class DialogEnterCode
|
||||
>
|
||||
<ha-textfield
|
||||
class="input"
|
||||
dialogInitialFocus
|
||||
?dialogInitialFocus=${!this._narrow}
|
||||
id="code"
|
||||
.label=${this.hass.localize("ui.dialogs.enter_code.input_label")}
|
||||
type="password"
|
||||
@ -134,6 +139,7 @@ export class DialogEnterCode
|
||||
.label=${this.hass.localize("ui.dialogs.enter_code.input_label")}
|
||||
type="password"
|
||||
inputmode="numeric"
|
||||
?dialogInitialFocus=${!this._narrow}
|
||||
></ha-textfield>
|
||||
<div class="keypad">
|
||||
${BUTTONS.map((value) =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user