From f7727e24b96a035a0d5b02d08947bbd1e313e082 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Sat, 10 Oct 2026 17:47:13 +0200 Subject: [PATCH] fix: Download choices open off the left edge of the screen on phones (#32179) On a narrow phone screen, the Download choices in the chat header menu, in a chat's menu in the sidebar and in the note menu opened to the left of the menu, past the edge of the screen, with their labels cut off. When there is no room for them on either side of the menu, they now open over the menu, fully on screen. Where there is room beside the menu, they open as before. Fixes #32015 --- src/lib/components/common/DropdownSub.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/components/common/DropdownSub.svelte b/src/lib/components/common/DropdownSub.svelte index 1a8c355316..31185f156a 100644 --- a/src/lib/components/common/DropdownSub.svelte +++ b/src/lib/components/common/DropdownSub.svelte @@ -76,7 +76,12 @@ contentEl.style.paddingLeft = `${sideOffset}px`; } else { // Open to the left: position flush with trigger, bridge gap with right padding - contentEl.style.right = `${window.innerWidth - rect.left}px`; + // Neither side fits on narrow screens: overlap the menu to stay on screen + const right = Math.min( + window.innerWidth - rect.left, + window.innerWidth - contentWidth - sideOffset - 16 + ); + contentEl.style.right = `${right}px`; contentEl.style.left = 'auto'; contentEl.style.paddingRight = `${sideOffset}px`; }