Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): keep SelectPopup anchored when scrolling inner containers #48166

OpenMohamedSayed0573(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/48166/headopened View on GitHub

Fixes #48165.

Problem

Opening a select dropdown in Settings (for example the Linear or Jira project binding picker in IssueTrackerSettings, or any of the ~20 other SelectPopup call sites that omit alignItemWithTrigger={false}) opens the popup directly over its trigger and leaves it frozen at its opening viewport position while the Settings pane scrolls underneath it.

SelectPopup in apps/web/src/components/ui/select.tsx defaulted alignItemWithTrigger to true. In Base UI's SelectPositioner, that mode sets disableAnchorTracking: true and position: fixed and relies on document scroll lock, which does not lock inner overflow-y-auto containers such as [data-settings-page-scroll]. Even with anchor tracking enabled, SelectPrimitive.Positioner lacked data-anchor-hidden:invisible, so scrolling a trigger completely out of its clipping container left the popup visible over the Settings header.

Change

  • Default alignItemWithTrigger to false in SelectPopup (apps/web/src/components/ui/select.tsx) so Floating UI tracks ancestor scrolls by default. Zero callers in apps/web opt into alignItemWithTrigger={true}, while 73 already pass alignItemWithTrigger={false}.
  • Add data-anchor-hidden:invisible to SelectPrimitive.Positioner so an open popup hides when its trigger scrolls out of the clipping container and reappears when scrolled back into view.

Scope

Fixes #48165 in apps/web/src/components/ui/select.tsx. Applies to web and Electron desktop (both render apps/web). Mobile uses native Menu in IssueTrackerSection and is unaffected.

Verification

BeforeAfter
Before: SelectPopup stays frozen in place while Settings scrolls
Before MP4
After: SelectPopup opens below trigger, tracks scroll, and hides out of view
After MP4
  • Live dev app (/settings/threads Snooze options, bare <SelectPopup>): Measured trigger and popup geometry while scrolling [data-settings-page-scroll] (scrollTop 450 -> 600 -> 950 -> 600). Before the fix, the popup covered the trigger and stayed pinned while sections scrolled underneath it. After the fix, the popup opened 4 px below the trigger (triggerBottom: 400, popupTop: 404), moved by the exact 150 px scroll delta (triggerBottom: 250, popupTop: 254), hid when scrolled past the header (anchorHidden: true, popupVisible: false), and reappeared anchored below the trigger on scrolling back.
  • Existing browser tests: Verified CommandPaletteContent.browser.test.tsx, EasDeviceHostEditor.browser.test.tsx, AcpSessionManagementSection.browser.test.tsx (24/24 passed), and ScheduledTasksSettings.browser.test.tsx (15/15 passed) in Chromium.
  • Checks: Ran vp run check:changed upstream/main (format, lint, knip, typecheck across 2 packages, and react compiler all passed).
  • Not checked directly: Tested in Chromium web; did not run inside the packaged Electron binary (which renders the same apps/web bundle).

Written with Gemini 4 Neon in T3 Code (Antigravity harness).

    1. Pushedc2f7a07

    2. juliusmarminge added labelstakeover:needs-julius

    3. juliusmarminge removed labelstakeover:in-progress

Sign in to join this conversation.