mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-15 22:10:20 +00:00
Fix scrolling items in the bottom into view (#26830)
This commit is contained in:
@@ -739,12 +739,12 @@ export default class HaAutomationActionRow extends LitElement {
|
||||
this._collapsed = false;
|
||||
|
||||
if (this.narrow) {
|
||||
requestAnimationFrame(() => {
|
||||
window.setTimeout(() => {
|
||||
this.scrollIntoView({
|
||||
block: "start",
|
||||
behavior: "smooth",
|
||||
});
|
||||
});
|
||||
}, 180); // duration of transition of added padding for bottom sheet
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -710,12 +710,12 @@ export default class HaAutomationConditionRow extends LitElement {
|
||||
this._collapsed = false;
|
||||
|
||||
if (this.narrow) {
|
||||
requestAnimationFrame(() => {
|
||||
window.setTimeout(() => {
|
||||
this.scrollIntoView({
|
||||
block: "start",
|
||||
behavior: "smooth",
|
||||
});
|
||||
});
|
||||
}, 180); // duration of transition of added padding for bottom sheet
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -274,7 +274,11 @@ export class HaManualAutomationEditor extends LitElement {
|
||||
})}
|
||||
>
|
||||
<div class="content-wrapper">
|
||||
<div class="content">
|
||||
<div
|
||||
class="content ${this._sidebarConfig && this.narrow
|
||||
? "has-bottom-sheet"
|
||||
: ""}"
|
||||
>
|
||||
<slot name="alerts"></slot>
|
||||
${this._renderContent()}
|
||||
</div>
|
||||
|
||||
@@ -408,12 +408,12 @@ export default class HaAutomationOptionRow extends LitElement {
|
||||
this._collapsed = false;
|
||||
|
||||
if (this.narrow) {
|
||||
requestAnimationFrame(() => {
|
||||
window.setTimeout(() => {
|
||||
this.scrollIntoView({
|
||||
block: "start",
|
||||
behavior: "smooth",
|
||||
});
|
||||
});
|
||||
}, 180); // duration of transition of added padding for bottom sheet
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -136,6 +136,11 @@ export const manualEditorStyles = css`
|
||||
.content {
|
||||
padding-top: 24px;
|
||||
padding-bottom: 72px;
|
||||
transition: padding-bottom 180ms ease-in-out;
|
||||
}
|
||||
|
||||
.content.has-bottom-sheet {
|
||||
padding-bottom: calc(90vh - 72px);
|
||||
}
|
||||
|
||||
ha-automation-sidebar {
|
||||
|
||||
@@ -520,12 +520,12 @@ export default class HaAutomationTriggerRow extends LitElement {
|
||||
this._selected = true;
|
||||
|
||||
if (this.narrow) {
|
||||
requestAnimationFrame(() => {
|
||||
window.setTimeout(() => {
|
||||
this.scrollIntoView({
|
||||
block: "start",
|
||||
behavior: "smooth",
|
||||
});
|
||||
});
|
||||
}, 180);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -236,12 +236,12 @@ export default class HaScriptFieldRow extends LitElement {
|
||||
} satisfies ScriptFieldSidebarConfig);
|
||||
|
||||
if (this.narrow) {
|
||||
requestAnimationFrame(() => {
|
||||
window.setTimeout(() => {
|
||||
this.scrollIntoView({
|
||||
block: "start",
|
||||
behavior: "smooth",
|
||||
});
|
||||
});
|
||||
}, 180); // duration of transition of added padding for bottom sheet
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,10 +76,12 @@ export default class HaScriptFields extends LitElement {
|
||||
row.focus();
|
||||
|
||||
if (this.narrow) {
|
||||
window.setTimeout(() => {
|
||||
row.scrollIntoView({
|
||||
block: "start",
|
||||
behavior: "smooth",
|
||||
});
|
||||
}, 180); // duration of transition of added padding for bottom sheet
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -218,7 +218,11 @@ export class HaManualScriptEditor extends LitElement {
|
||||
})}
|
||||
>
|
||||
<div class="content-wrapper">
|
||||
<div class="content">
|
||||
<div
|
||||
class="content ${this._sidebarConfig && this.narrow
|
||||
? "has-bottom-sheet"
|
||||
: ""}"
|
||||
>
|
||||
<slot name="alerts"></slot>
|
||||
${this._renderContent()}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user