fix(web): keep SelectPopup anchored when scrolling inner containers #48166
main fromrefs/pull/48166/head·opened View on GitHubFixes #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
alignItemWithTriggertofalseinSelectPopup(apps/web/src/components/ui/select.tsx) so Floating UI tracks ancestor scrolls by default. Zero callers inapps/webopt intoalignItemWithTrigger={true}, while 73 already passalignItemWithTrigger={false}. - Add
data-anchor-hidden:invisibletoSelectPrimitive.Positionerso 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#
| Before | After |
|---|---|
![]() Before MP4 | ![]() After MP4 |
- Live dev app (
/settings/threadsSnooze options, bare<SelectPopup>): Measured trigger and popup geometry while scrolling[data-settings-page-scroll](scrollTop450 -> 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), andScheduledTasksSettings.browser.test.tsx(15/15 passed) in Chromium. - Checks: Ran
vp run check:changed upstream/main(format,lint,knip,typecheckacross 2 packages, andreact compilerall passed). - Not checked directly: Tested in Chromium web; did not run inside the packaged Electron binary (which renders the same
apps/webbundle).
Written with Gemini 4 Neon in T3 Code (Antigravity harness).
- 1
- 2
Pushedc2f7a07
juliusmarminge added labelstakeover:needs-julius
juliusmarminge removed labelstakeover:in-progress
Sign in to join this conversation.

