Use automation sidebar in scripts (#26602)

This commit is contained in:
Wendelin
2025-08-21 12:21:00 +02:00
committed by GitHub
parent 3a70310f78
commit 5a540dd889
31 changed files with 2222 additions and 868 deletions

View File

@@ -21,6 +21,8 @@ export default class HaScriptFields extends LitElement {
@property({ attribute: false }) public highlightedFields?: Fields;
@property({ type: Boolean }) public narrow = false;
private _focusLastActionOnChange = false;
protected render() {
@@ -39,6 +41,7 @@ export default class HaScriptFields extends LitElement {
@value-changed=${this._fieldChanged}
.hass=${this.hass}
?highlight=${this.highlightedFields?.[key] !== undefined}
.narrow=${this.narrow}
>
</ha-script-field-row>
`
@@ -71,8 +74,11 @@ export default class HaScriptFields extends LitElement {
"ha-script-field-row:last-of-type"
)!;
row.updateComplete.then(() => {
row.expand();
row.scrollIntoView();
row.openSidebar();
if (this.narrow) {
row.scrollIntoView();
}
row.focus();
});
}