From 7ce1081161ba0091756323186c1b743acdd886e1 Mon Sep 17 00:00:00 2001 From: ajnart Date: Tue, 28 Jul 2026 16:17:31 +0200 Subject: [PATCH] fix: preserve mobile section focus --- .../src/app/[locale]/boards/(content)/_header-actions.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx b/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx index e6c8093af..1c2ea43d0 100644 --- a/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx +++ b/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx @@ -269,6 +269,7 @@ const MobileMoreMenu = ({ showSettings }: { showSettings: boolean }) => { const tProfile = useScopedI18n("common.userAvatar.menu"); const reduceMotion = useReducedMotion(); const [opened, disclosure] = useDisclosure(false); + const moreTriggerRef = useRef(null); const pendingSectionAnchorId = useRef(null); const desktopLayout = getDesktopLayout(board); const sections = useMemo( @@ -284,14 +285,14 @@ const MobileMoreMenu = ({ showSettings }: { showSettings: boolean }) => { const focusPendingSection = () => { const anchorId = pendingSectionAnchorId.current; pendingSectionAnchorId.current = null; - if (!anchorId) return; + if (anchorId && focusMobileBoardSection({ anchorId, reduceMotion })) return; - focusMobileBoardSection({ anchorId, reduceMotion }); + moreTriggerRef.current?.focus({ preventScroll: true }); }; return ( <> - + { size="auto" padding="md" overlayProps={{ backgroundOpacity: 0.45, blur: 2 }} + returnFocus={false} onExitTransitionEnd={focusPendingSection} styles={{ content: {