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
MohamedSayed0573(GitHub profile, opens in a new tab) linked this to fix #48165
tanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
No actionable comments were generated in the recent review.
Walkthrough
-
SelectPopup now defaults alignItemWithTrigger to false. Its positioner also becomes invisible when the anchor is hidden.
Changes: Select popup positioning
Layer / File(s) Summary Popup positioning defaults
apps/web/src/components/ui/select.tsxSelectPopup defaults alignItemWithTrigger to false. The positioner uses data-anchor-hidden:invisiblewhen its anchor is hidden.Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
flamboh,juliusmarminge
Merge Risk:
Minimal · up toc3acd-
Select popups in Settings now open below their triggers, follow them when the pane scrolls, and hide when the trigger scrolls out of view. The change is small and easy to revert, and no merge-blocking risk was found.
Pre-merge checks:
4-
Check name Status Explanation Title check The title names the main change: SelectPopup stays anchored to its trigger when inner scroll containers scroll. The raw summary confirms the change to alignItemWithTrigger default and the anchor-hidde… Description check The description follows the template's sections: Problem, Change, Scope, and Verification. It explains the root cause, lists the two code changes, links issue #48165, and gives before/after evidence w…Linked Issues check [ #48165] Requires Settings SelectPopup dropdowns to (1) open below their trigger, (2) track the trigger while the Settings pane scrolls, and (3) hide when the trigger leaves the clipping container. Th…Out of Scope Changes check The whole-PR diff against merge base 71217d7 touches one file, apps/web/src/components/ui/select.tsx, with two changed lines. Both lines implement the issue objectives directly. No unrelated changes w… Full details: Title check
-
Explanation
The title names the main change: SelectPopup stays anchored to its trigger when inner scroll containers scroll. The raw summary confirms the change to alignItemWithTrigger default and the anchor-hidden class, which address that behavior. The title uses the conventional commit format and is specific.
Full details: Description check
-
Explanation
The description follows the template's sections: Problem, Change, Scope, and Verification. It explains the root cause, lists the two code changes, links issue
#48165, and gives before/after evidence with measured geometry. Verification covers existing browser tests and repo checks, and it states what was not checked (packaged Electron binary). The template's comments are omitted, but the required content is present. The model and harness line is also included, as the template asks. Minor gap: the Scope section does not explain why a bug-fix issue link suffices, but the issue link itself covers this.
Full details: Linked Issues check
-
Explanation
[
#48165] Requires Settings SelectPopup dropdowns to (1) open below their trigger, (2) track the trigger while the Settings pane scrolls, and (3) hide when the trigger leaves the clipping container. The reviewed diff covers all three in apps/web/src/components/ui/select.tsx: (1) and (2) are met by changing the SelectPopup default from alignItemWithTrigger = true to false, which disables the fixed, non-tracking positioning that caused the frozen popup. (3) is met by adding data-anchor-hidden:invisible to the SelectPrimitive.Positioner className. The issue asks for no automated test, and the change is a two-line edit. The Base UI runtime behavior of data-anchor-hidden was not re-verified from source. The author's live-app measurements in the PR description support the behavior. No unmet coding requirement remains for the issue scope.
Full details: Out of Scope Changes check
-
Explanation
The whole-PR diff against merge base 71217d7 touches one file, apps/web/src/components/ui/select.tsx, with two changed lines. Both lines implement the issue objectives directly. No unrelated changes were found. Mobile behavior is unchanged because the change does not touch the native Menu path, which matches the stated scope.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: e0661db
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ef86a6ae-2499-4eb3-af9b-ce64c6681501
Commits-
Reviewing files that changed from the base of the PR and between e0661db2c851d1c8c2f126d37c40dc3e665e5ec6 and c3acda4a8fb14e242f61af5c01f413364041d768.
Files selected for processing: 1-
apps/web/src/components/ui/select.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
-
Sign in to join this conversation.


Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — This changes default dropdown alignment across existing callers and hides popups when their anchors are hidden. A human needs to confirm the shared positioning-default change is intended across affected product surfaces.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).