fix(react): flip Select caret when content collides above trigger - #83
Merged
Merged
Conversation
Default SelectContent to popper positioning with a Radix Arrow that follows data-side, so long lists stay anchored to the trigger and the decorative caret points at the control when the menu flips above.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On long Select lists (e.g. Artifacts → GSC board site picker), the shared Select looks correct when a top item is selected (menu opens below the trigger).
When a bottom item is selected, the menu flips above the trigger, but:
data-side=top).Expected
data-side=bottom: caret on the top edge of the menu, pointing toward the trigger.data-side=top: caret on the bottom edge of the menu, pointing toward the trigger.Screenshots (redacted)
Top item selected — menu below, caret on top edge (OK):
Bottom item selected — menu above, caret still on top edge (bug):
Close-up of flipped menu + wrong caret:
Fix
In
packages/react/src/components/select.tsx:SelectContentto Radixposition="popper"withsideOffset/collisionPaddingso the panel stays anchored to the trigger when it flips.SelectPrimitive.Arrow(popper-only) so the caret followsdata-side.Scoped to the shared Select primitive only — no GSC artifact business-logic changes.
Test plan
No dedicated Select unit/story suite in-repo; verified via
packages/reacttypecheck after the change.Issue
Could not create a tracking issue on
UsefulSoftwareCo/executor(GitHub API 403 — token cannot open issues there). Problem section above is the bug description.