-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Focus on card search input when adding new card #23309
Conversation
Co-authored-by: Simon Lamon <32477463+silamon@users.noreply.github.com>
Doesn't seem to work |
yeah I fixed it |
@@ -120,7 +127,7 @@ export class HuiCreateDialogCard | |||
.label=${this.hass!.localize( | |||
"ui.panel.lovelace.editor.cardpicker.by_card" | |||
)} | |||
dialogInitialFocus | |||
dialogInitialFocus=${ifDefined(this._narrow ? "" : undefined)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dialogInitialFocus=${ifDefined(this._narrow ? "" : undefined)} | |
.dialogInitialFocus=${Boolean(this._narrow)} |
I think this is simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not possible, the dialog searches for an attribute, not for a property
@@ -133,6 +140,7 @@ export class HuiCreateDialogCard | |||
this._currTabIndex === 0 | |||
? html` | |||
<hui-card-picker | |||
dialogInitialFocus=${ifDefined(this._narrow ? undefined : "")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dialogInitialFocus=${ifDefined(this._narrow ? undefined : "")} | |
.dialogInitialFocus=${Boolean(this._narrow)} |
this._narrow = matchMedia( | ||
"all and (max-width: 450px), all and (max-height: 500px)" | ||
).matches; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note: we should make this a utility function at some point
Breaking change
None.
Proposed change
Type of change
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: