Scroll to new added trigger/condition/row (#13473)

This commit is contained in:
Paulus Schoutsen 2022-08-24 09:58:29 -04:00 committed by GitHub
parent c2542a3baa
commit d64ade3848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 6 deletions

View File

@ -92,8 +92,11 @@ export default class HaAutomationAction extends LitElement {
const row = this.shadowRoot!.querySelector<HaAutomationActionRow>(
"ha-automation-action-row:last-of-type"
)!;
row.expand();
row.focus();
row.updateComplete.then(() => {
row.expand();
row.scrollIntoView();
row.focus();
});
}
}
@ -178,6 +181,7 @@ export default class HaAutomationAction extends LitElement {
ha-automation-action-row {
display: block;
margin-bottom: 16px;
scroll-margin-top: 48px;
}
ha-svg-icon {
height: 20px;

View File

@ -69,8 +69,11 @@ export default class HaAutomationCondition extends LitElement {
const row = this.shadowRoot!.querySelector<HaAutomationConditionRow>(
"ha-automation-condition-row:last-of-type"
)!;
row.expand();
row.focus();
row.updateComplete.then(() => {
row.expand();
row.scrollIntoView();
row.focus();
});
}
}
@ -187,6 +190,7 @@ export default class HaAutomationCondition extends LitElement {
ha-automation-condition-row {
display: block;
margin-bottom: 16px;
scroll-margin-top: 48px;
}
ha-svg-icon {
height: 20px;

View File

@ -88,8 +88,11 @@ export default class HaAutomationTrigger extends LitElement {
const row = this.shadowRoot!.querySelector<HaAutomationTriggerRow>(
"ha-automation-trigger-row:last-of-type"
)!;
row.expand();
row.focus();
row.updateComplete.then(() => {
row.expand();
row.scrollIntoView();
row.focus();
});
}
}
@ -167,6 +170,7 @@ export default class HaAutomationTrigger extends LitElement {
ha-automation-trigger-row {
display: block;
margin-bottom: 16px;
scroll-margin-top: 48px;
}
ha-svg-icon {
height: 20px;