mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-16 06:20:18 +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;
|
this._collapsed = false;
|
||||||
|
|
||||||
if (this.narrow) {
|
if (this.narrow) {
|
||||||
requestAnimationFrame(() => {
|
window.setTimeout(() => {
|
||||||
this.scrollIntoView({
|
this.scrollIntoView({
|
||||||
block: "start",
|
block: "start",
|
||||||
behavior: "smooth",
|
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;
|
this._collapsed = false;
|
||||||
|
|
||||||
if (this.narrow) {
|
if (this.narrow) {
|
||||||
requestAnimationFrame(() => {
|
window.setTimeout(() => {
|
||||||
this.scrollIntoView({
|
this.scrollIntoView({
|
||||||
block: "start",
|
block: "start",
|
||||||
behavior: "smooth",
|
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-wrapper">
|
||||||
<div class="content">
|
<div
|
||||||
|
class="content ${this._sidebarConfig && this.narrow
|
||||||
|
? "has-bottom-sheet"
|
||||||
|
: ""}"
|
||||||
|
>
|
||||||
<slot name="alerts"></slot>
|
<slot name="alerts"></slot>
|
||||||
${this._renderContent()}
|
${this._renderContent()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -408,12 +408,12 @@ export default class HaAutomationOptionRow extends LitElement {
|
|||||||
this._collapsed = false;
|
this._collapsed = false;
|
||||||
|
|
||||||
if (this.narrow) {
|
if (this.narrow) {
|
||||||
requestAnimationFrame(() => {
|
window.setTimeout(() => {
|
||||||
this.scrollIntoView({
|
this.scrollIntoView({
|
||||||
block: "start",
|
block: "start",
|
||||||
behavior: "smooth",
|
behavior: "smooth",
|
||||||
});
|
});
|
||||||
});
|
}, 180); // duration of transition of added padding for bottom sheet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,6 +136,11 @@ export const manualEditorStyles = css`
|
|||||||
.content {
|
.content {
|
||||||
padding-top: 24px;
|
padding-top: 24px;
|
||||||
padding-bottom: 72px;
|
padding-bottom: 72px;
|
||||||
|
transition: padding-bottom 180ms ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content.has-bottom-sheet {
|
||||||
|
padding-bottom: calc(90vh - 72px);
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-automation-sidebar {
|
ha-automation-sidebar {
|
||||||
|
|||||||
@@ -520,12 +520,12 @@ export default class HaAutomationTriggerRow extends LitElement {
|
|||||||
this._selected = true;
|
this._selected = true;
|
||||||
|
|
||||||
if (this.narrow) {
|
if (this.narrow) {
|
||||||
requestAnimationFrame(() => {
|
window.setTimeout(() => {
|
||||||
this.scrollIntoView({
|
this.scrollIntoView({
|
||||||
block: "start",
|
block: "start",
|
||||||
behavior: "smooth",
|
behavior: "smooth",
|
||||||
});
|
});
|
||||||
});
|
}, 180);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -236,12 +236,12 @@ export default class HaScriptFieldRow extends LitElement {
|
|||||||
} satisfies ScriptFieldSidebarConfig);
|
} satisfies ScriptFieldSidebarConfig);
|
||||||
|
|
||||||
if (this.narrow) {
|
if (this.narrow) {
|
||||||
requestAnimationFrame(() => {
|
window.setTimeout(() => {
|
||||||
this.scrollIntoView({
|
this.scrollIntoView({
|
||||||
block: "start",
|
block: "start",
|
||||||
behavior: "smooth",
|
behavior: "smooth",
|
||||||
});
|
});
|
||||||
});
|
}, 180); // duration of transition of added padding for bottom sheet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,10 +76,12 @@ export default class HaScriptFields extends LitElement {
|
|||||||
row.focus();
|
row.focus();
|
||||||
|
|
||||||
if (this.narrow) {
|
if (this.narrow) {
|
||||||
row.scrollIntoView({
|
window.setTimeout(() => {
|
||||||
block: "start",
|
row.scrollIntoView({
|
||||||
behavior: "smooth",
|
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-wrapper">
|
||||||
<div class="content">
|
<div
|
||||||
|
class="content ${this._sidebarConfig && this.narrow
|
||||||
|
? "has-bottom-sheet"
|
||||||
|
: ""}"
|
||||||
|
>
|
||||||
<slot name="alerts"></slot>
|
<slot name="alerts"></slot>
|
||||||
${this._renderContent()}
|
${this._renderContent()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user