mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-08 10:29:37 +00:00
Use automation sidebar in scripts (#26602)
This commit is contained in:
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user