Fix automation editor safe area (#27292)

This commit is contained in:
Wendelin
2025-10-02 12:01:47 +02:00
committed by Bram Kragten
parent ac49fc7aba
commit 4dc6a37bad
6 changed files with 33 additions and 32 deletions

View File

@@ -1,6 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, query, state } from "lit/decorators";
import { styleMap } from "lit/directives/style-map";
import { fireEvent } from "../common/dom/fire_event";
import { BOTTOM_SHEET_ANIMATION_DURATION_MS } from "./ha-bottom-sheet";
@@ -37,13 +36,14 @@ export class HaResizableBottomSheet extends LitElement {
return html`<dialog
open
@transitionend=${this._handleTransitionEnd}
style=${styleMap({
height: this._dialogViewportHeight
? `${this._dialogViewportHeight}vh`
: "auto",
maxHeight: `${this._dialogMaxViewpointHeight}vh`,
minHeight: `${this._dialogMinViewpointHeight}vh`,
})}
style=${`
--height: ${this._dialogViewportHeight}vh;
--height: ${this._dialogViewportHeight}dvh;
--max-height: ${this._dialogMaxViewpointHeight}vh;
--max-height: ${this._dialogMaxViewpointHeight}dvh;
--min-height: ${this._dialogMinViewpointHeight}vh;
--min-height: ${this._dialogMinViewpointHeight}dvh;
`}
>
<div class="handle-wrapper">
<div
@@ -213,9 +213,11 @@ export class HaResizableBottomSheet extends LitElement {
cursor: grabbing;
}
dialog {
height: auto;
max-height: 70vh;
min-height: 30vh;
height: var(--height, auto);
max-height: var(--max-height, 70vh);
max-height: var(--max-height, 70dvh);
min-height: var(--min-height, 30vh);
min-height: var(--min-height, 30dvh);
background-color: var(
--ha-bottom-sheet-surface-background,
var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)),
@@ -254,7 +256,6 @@ export class HaResizableBottomSheet extends LitElement {
border-bottom-width: 0;
border-style: var(--ha-bottom-sheet-border-style);
border-color: var(--ha-bottom-sheet-border-color);
margin-bottom: var(--safe-area-inset-bottom);
margin-left: var(--safe-area-inset-left);
margin-right: var(--safe-area-inset-right);
}