From e580fb8b5cb71c8ea6afb79e4f6abc09e218d56e Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Fri, 9 Oct 2026 10:41:39 +0200 Subject: [PATCH] Keep dropdown menus clear of safe areas (#54762) --- src/components/ha-dropdown.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/components/ha-dropdown.ts b/src/components/ha-dropdown.ts index 24880e5c2e..eefa27f79f 100644 --- a/src/components/ha-dropdown.ts +++ b/src/components/ha-dropdown.ts @@ -110,6 +110,22 @@ export class HaDropdown extends Dropdown { wa-popup::part(popup) { z-index: 200; } + + /* The auto size ignores safe areas, so a long menu could end up + behind the Android navigation bar or the notch. */ + wa-popup[data-current-placement^="bottom"] #menu { + max-height: calc( + var(--auto-size-available-height) - var( + --safe-area-inset-bottom, + 0px + ) + ) !important; + } + wa-popup[data-current-placement^="top"] #menu { + max-height: calc( + var(--auto-size-available-height) - var(--safe-area-inset-top, 0px) + ) !important; + } `, ]; }