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 1 commit 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. tanstack-source added labelsbug

    2. 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).
    3. Explain Change →

      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.tsx
      SelectPopup defaults alignItemWithTrigger to false. The positioner uses data-anchor-hidden:invisible when 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 to c3acd

      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: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe 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 checkPassedThe 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 checkPassed[#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 checkPassedThe 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

      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.