feat: Update default menu placement to "auto"
#373
Merged
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.
This PR implements a change I've been meaning to make for a while. The
menuPlacementprop determines where the select menu is placed depending on available screen space:By default, the menu will always stay on the bottom (essentially meaning the prop defaults to
"bottom"). However, the default behavior for the Chakra menus and popovers is to flip to the top if there isn't enough vertical space.So I finally decided to make the executive decision to default this prop to
"auto"to reflect that behavior, after having set it manually in so many of my own projects. This is actually already the case inchakra-react-select@6, but I wanted to update v5 to match. Here's what the behavior looks like:Screen.Recording.2026-01-09.at.5.21.33.PM.mov
It is always possible to go back to the default behavior of react-select by passing the prop
menuPlacement="bottom", so this isn't really a breaking change.