From 0aa711bcba06f494c8cdbe58f85cdb569003310f Mon Sep 17 00:00:00 2001 From: midego <61051030+midego1@users.noreply.github.com> Date: Thu, 17 Sep 2026 12:54:05 +0700 Subject: [PATCH] Anchor Select menus to their trigger instead of the selected option SelectContent defaulted to position="item-aligned", which places the list so the selected option sits over the trigger. With a late option selected in a long list, the panel shifted up over the page and clipped. Default to popper positioning (sideOffset 4, collisionPadding 8) so the list opens below the trigger and flips above when there is no room, and render a Radix Arrow so a caret points at the trigger on either side. Co-authored-by: Cursor Agent Co-Authored-By: Claude Opus 5 --- .changeset/select-anchor-to-trigger.md | 5 +++++ packages/react/src/components/select.tsx | 28 ++++++++++++++++++------ 2 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 .changeset/select-anchor-to-trigger.md diff --git a/.changeset/select-anchor-to-trigger.md b/.changeset/select-anchor-to-trigger.md new file mode 100644 index 0000000000..d64a7c08b7 --- /dev/null +++ b/.changeset/select-anchor-to-trigger.md @@ -0,0 +1,5 @@ +--- +"executor": patch +--- + +Open dropdown menus anchored to their trigger, so picking an option near the end of a long list no longer shifts the menu up over the page and clips it. diff --git a/packages/react/src/components/select.tsx b/packages/react/src/components/select.tsx index b449245fe1..358c0da360 100644 --- a/packages/react/src/components/select.tsx +++ b/packages/react/src/components/select.tsx @@ -53,8 +53,13 @@ function SelectTrigger({ function SelectContent({ className, children, - position = "item-aligned", + // Popper keeps the panel anchored to the trigger (with collision flip) so a + // long list does not leave the selected row stranded at the far end of an + // item-aligned floating panel. Arrow only renders in popper mode. + position = "popper", align = "center", + sideOffset = 4, + collisionPadding = 8, ...props }: React.ComponentProps) { return ( @@ -62,26 +67,35 @@ function SelectContent({ {children} + {position === "popper" ? ( + + ) : null} );