From faf9231bc29d426dac070aa41f24400337d52a8f Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Fri, 25 Sep 2026 12:17:35 -0500 Subject: [PATCH] fix(desktop): keep submenus pinned to their trigger during scroll A portaled DropdownMenuSubContent keeps its Floating UI positioning on the default "optimized" strategy: passive scroll listeners that only reposition between events. While the parent Content scrolls, the submenu visibly lags behind (or fully detaches from) its SubTrigger because the scroll -> getBoundingClientRect -> reposition pipeline cannot keep pace with fast wheel events. Set updatePositionStrategy="always" so autoUpdate runs a continuous rAF loop and the submenu tracks its trigger frame-by-frame. The prop is placed after the {...props} spread so callers cannot accidentally revert it. Fixes #55856 Salvages #55858 (same one-prop fix, authored by David Metcalfe) Co-authored-by: David Metcalfe <80915+DavidMetcalfe@users.noreply.github.com> --- apps/desktop/src/components/ui/dropdown-menu.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/desktop/src/components/ui/dropdown-menu.tsx b/apps/desktop/src/components/ui/dropdown-menu.tsx index 85215c852b..0937f6c08a 100644 --- a/apps/desktop/src/components/ui/dropdown-menu.tsx +++ b/apps/desktop/src/components/ui/dropdown-menu.tsx @@ -487,6 +487,12 @@ function DropdownMenuSubContent({ // `overflow` clip. Radix Popper still anchors it to the SubTrigger and // handles collision/flip. React events still bubble through the portal, so // the parent menu doesn't treat a press here as an outside click. + // + // `updatePositionStrategy="always"` makes Floating UI's autoUpdate use a + // continuous rAF loop instead of the default "optimized" passive scroll + // listeners. Without it, a portaled submenu visibly lags behind its trigger + // while the parent Content scrolls: the scroll → getBoundingClientRect → + // reposition pipeline cannot keep pace with fast wheel events. )