diff --git a/src/components/ha-dialog.ts b/src/components/ha-dialog.ts index 0fb94447ddbb..b5734d4dd8b3 100644 --- a/src/components/ha-dialog.ts +++ b/src/components/ha-dialog.ts @@ -90,7 +90,7 @@ export class HaDialog extends DialogBase { } .mdc-dialog__actions { justify-content: var(--justify-action-buttons, flex-end); - padding: 12px 16px max(var(--safe-area-inset-bottom), 16px) 16px; + padding: 12px 16px 16px 16px; } .mdc-dialog__actions span:nth-child(1) { flex: var(--secondary-action-button-flex, unset); @@ -100,6 +100,8 @@ export class HaDialog extends DialogBase { } .mdc-dialog__container { align-items: var(--vertical-align-dialog, center); + padding-top: var(--safe-area-inset-top); + padding-bottom: var(--safe-area-inset-bottom); } .mdc-dialog__title { padding: 16px 16px 0 16px; @@ -115,15 +117,17 @@ export class HaDialog extends DialogBase { padding: var(--dialog-content-padding, 24px); } :host([hideactions]) .mdc-dialog .mdc-dialog__content { - padding-bottom: max( - var(--dialog-content-padding, 24px), - var(--safe-area-inset-bottom) - ); + padding-bottom: var(--dialog-content-padding, 24px); } .mdc-dialog .mdc-dialog__surface { position: var(--dialog-surface-position, relative); top: var(--dialog-surface-top); margin-top: var(--dialog-surface-margin-top); + min-width: calc( + var(--mdc-dialog-min-width, 100vw) - var( + --safe-area-inset-left + ) - var(--safe-area-inset-right) + ); min-height: var(--mdc-dialog-min-height, auto); border-radius: var(--ha-dialog-border-radius, 24px); -webkit-backdrop-filter: var(--ha-dialog-surface-backdrop-filter, none); @@ -137,6 +141,24 @@ export class HaDialog extends DialogBase { display: flex; flex-direction: column; } + + @media all and (max-width: 450px), all and (max-height: 500px) { + .mdc-dialog .mdc-dialog__surface { + min-height: calc( + 100vh - var(--safe-area-inset-top, 0px) - var( + --safe-area-inset-bottom, + 0px + ) + ); + max-height: calc( + 100vh - var(--safe-area-inset-top, 0px) - var( + --safe-area-inset-bottom, + 0px + ) + ); + } + } + .header_title { display: flex; align-items: center; diff --git a/src/dialogs/more-info/controls/more-info-update.ts b/src/dialogs/more-info/controls/more-info-update.ts index 2fac850a0644..0bd5ed254fca 100644 --- a/src/dialogs/more-info/controls/more-info-update.ts +++ b/src/dialogs/more-info/controls/more-info-update.ts @@ -475,7 +475,6 @@ class MoreInfoUpdate extends LitElement { bottom: 0; margin: 0 -24px 0 -24px; margin-bottom: calc(-1 * max(var(--safe-area-inset-bottom), 24px)); - padding-bottom: var(--safe-area-inset-bottom); box-sizing: border-box; display: flex; flex-direction: column; diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index da6a0ccb5ce6..77bac1bfaaaf 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -651,7 +651,10 @@ export class MoreInfoDialog extends LitElement { ha-dialog { /* Set the top top of the dialog to a fixed position, so it doesnt jump when the content changes size */ --vertical-align-dialog: flex-start; - --dialog-surface-margin-top: 40px; + --dialog-surface-margin-top: max( + 40px, + var(--safe-area-inset-top, 0px) + ); --dialog-content-padding: 0; } diff --git a/src/dialogs/quick-bar/ha-quick-bar.ts b/src/dialogs/quick-bar/ha-quick-bar.ts index 38f2e1986d06..fa0ef45aad33 100644 --- a/src/dialogs/quick-bar/ha-quick-bar.ts +++ b/src/dialogs/quick-bar/ha-quick-bar.ts @@ -281,11 +281,11 @@ export class QuickBar extends LitElement { class="ha-scrollbar" style=${styleMap({ height: this._narrow - ? "calc(100vh - 56px)" - : `${Math.min( + ? "calc(100vh - 56px - var(--safe-area-inset-top, 0px) - var(--safe-area-inset-bottom, 0px))" + : `calc(${Math.min( items.length * (commandMode ? 56 : 72) + 26, 500 - )}px`, + )}px - var(--safe-area-inset-top, 0px) - var(--safe-area-inset-bottom, 0px))`, })} .items=${items} .renderItem=${this._renderItem} diff --git a/src/layouts/hass-tabs-subpage-data-table.ts b/src/layouts/hass-tabs-subpage-data-table.ts index 18c5e25d6e41..19b9265586e1 100644 --- a/src/layouts/hass-tabs-subpage-data-table.ts +++ b/src/layouts/hass-tabs-subpage-data-table.ts @@ -884,7 +884,13 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) { } .filter-dialog-content { - height: calc(100vh - 1px - 61px - var(--header-height)); + height: calc( + 100vh - + 70px - var(--header-height, 0px) - var( + --safe-area-inset-top, + 0px + ) - var(--safe-area-inset-bottom, 0px) + ); display: flex; flex-direction: column; } diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts index 5a2c8cf4986a..5671d905b57d 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts @@ -239,12 +239,8 @@ class DialogMQTTDeviceDebugInfo extends LitElement { } @media all and (max-width: 450px), all and (max-height: 500px) { ha-dialog { - --mdc-dialog-min-width: calc( - 100vw - var(--safe-area-inset-right) - var(--safe-area-inset-left) - ); - --mdc-dialog-max-width: calc( - 100vw - var(--safe-area-inset-right) - var(--safe-area-inset-left) - ); + --mdc-dialog-min-width: 100vw; + --mdc-dialog-max-width: 100vw; } } ha-switch { diff --git a/src/panels/config/helpers/dialog-helper-detail.ts b/src/panels/config/helpers/dialog-helper-detail.ts index 8e8e77f5526e..679c5328b6ed 100644 --- a/src/panels/config/helpers/dialog-helper-detail.ts +++ b/src/panels/config/helpers/dialog-helper-detail.ts @@ -430,7 +430,13 @@ export class DialogHelperDetail extends LitElement { } @media all and (max-width: 450px), all and (max-height: 500px) { ha-list { - height: calc(100vh - 184px); + height: calc( + 100vh - + 184px - var(--safe-area-inset-top, 0px) - var( + --safe-area-inset-bottom, + 0px + ) + ); } } `, diff --git a/src/panels/config/integrations/dialog-add-integration.ts b/src/panels/config/integrations/dialog-add-integration.ts index dec044c45327..5b6e6f3868a4 100644 --- a/src/panels/config/integrations/dialog-add-integration.ts +++ b/src/panels/config/integrations/dialog-add-integration.ts @@ -461,7 +461,9 @@ class AddIntegrationDialog extends LitElement { class="ha-scrollbar" style=${styleMap({ width: `${this._width}px`, - height: this._narrow ? "calc(100vh - 184px)" : "500px", + height: this._narrow + ? "calc(100vh - 184px - var(--safe-area-inset-top, 0px) - var(--safe-area-inset-bottom, 0px))" + : "500px", })} @click=${this._integrationPicked} @keypress=${this._handleKeyPress} diff --git a/src/panels/config/voice-assistants/dialog-expose-entity.ts b/src/panels/config/voice-assistants/dialog-expose-entity.ts index 4e2c52d6b2bd..cc8882a947ca 100644 --- a/src/panels/config/voice-assistants/dialog-expose-entity.ts +++ b/src/panels/config/voice-assistants/dialog-expose-entity.ts @@ -242,19 +242,21 @@ class DialogExposeEntity extends LitElement { } @media all and (max-width: 500px), all and (max-height: 500px) { ha-dialog { - --mdc-dialog-min-width: calc( - 100vw - var(--safe-area-inset-right) - var(--safe-area-inset-left) - ); - --mdc-dialog-max-width: calc( - 100vw - var(--safe-area-inset-right) - var(--safe-area-inset-left) - ); + --mdc-dialog-min-width: 100vw; + --mdc-dialog-max-width: 100vw; --mdc-dialog-min-height: 100%; --mdc-dialog-max-height: 100%; --vertical-align-dialog: flex-end; --ha-dialog-border-radius: 0px; } lit-virtualizer { - height: calc(100vh - 198px); + height: calc( + 100vh - + 210px - var(--safe-area-inset-top, 0px) - var( + --safe-area-inset-bottom, + 0px + ) + ); } search-input { --text-field-suffix-padding-left: unset; diff --git a/src/panels/config/zone/dialog-home-zone-detail.ts b/src/panels/config/zone/dialog-home-zone-detail.ts index 6456137611d5..47a6e3c0acb4 100644 --- a/src/panels/config/zone/dialog-home-zone-detail.ts +++ b/src/panels/config/zone/dialog-home-zone-detail.ts @@ -137,9 +137,8 @@ class DialogHomeZoneDetail extends LitElement { } @media all and (max-width: 450px), all and (max-height: 500px) { ha-dialog { - --mdc-dialog-min-width: calc( - 100vw - var(--safe-area-inset-right) - var(--safe-area-inset-left) - ); + --mdc-dialog-min-width: 100vw; + --mdc-dialog-max-width: 100vw; } } `, diff --git a/src/panels/config/zone/dialog-zone-detail.ts b/src/panels/config/zone/dialog-zone-detail.ts index 4689590be5b8..da9aa4615a9b 100644 --- a/src/panels/config/zone/dialog-zone-detail.ts +++ b/src/panels/config/zone/dialog-zone-detail.ts @@ -224,9 +224,8 @@ class DialogZoneDetail extends LitElement { } @media all and (max-width: 450px), all and (max-height: 500px) { ha-dialog { - --mdc-dialog-min-width: calc( - 100vw - var(--safe-area-inset-right) - var(--safe-area-inset-left) - ); + --mdc-dialog-min-width: 100vw; + --mdc-dialog-max-width: 100vw; } } ha-form.passive {