diff --git a/docs/images/select-bottom-selected-closeup.png b/docs/images/select-bottom-selected-closeup.png new file mode 100644 index 0000000000..67a36a206d Binary files /dev/null and b/docs/images/select-bottom-selected-closeup.png differ diff --git a/docs/images/select-bottom-selected.png b/docs/images/select-bottom-selected.png new file mode 100644 index 0000000000..612061cda8 Binary files /dev/null and b/docs/images/select-bottom-selected.png differ diff --git a/docs/images/select-top-selected.png b/docs/images/select-top-selected.png new file mode 100644 index 0000000000..52e255391e Binary files /dev/null and b/docs/images/select-top-selected.png differ 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} );