mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 02:49:51 +00:00
Fix pickers not getting focus (#14068)
* fix focus pickers * await nextRender instead of setTimeout * use bram's code * Update src/components/ha-target-picker.ts Co-authored-by: Steve Repsher <steverep@users.noreply.github.com> Co-authored-by: Steve Repsher <steverep@users.noreply.github.com>
This commit is contained in:
@@ -107,16 +107,14 @@ export class HaEntityPicker extends LitElement {
|
||||
|
||||
@query("ha-combo-box", true) public comboBox!: HaComboBox;
|
||||
|
||||
public open() {
|
||||
this.updateComplete.then(() => {
|
||||
this.comboBox?.open();
|
||||
});
|
||||
public async open() {
|
||||
await this.updateComplete;
|
||||
await this.comboBox?.open();
|
||||
}
|
||||
|
||||
public focus() {
|
||||
this.updateComplete.then(() => {
|
||||
this.comboBox?.focus();
|
||||
});
|
||||
public async focus() {
|
||||
await this.updateComplete;
|
||||
await this.comboBox?.focus();
|
||||
}
|
||||
|
||||
private _initedStates = false;
|
||||
|
||||
Reference in New Issue
Block a user