Open
Description
Provide a general summary of the issue here
The Popover
component flips even when there's space to render.
The position calculations don't seem to take the maxHeight
prop into account.
Screen.Recording.2025-03-09.at.23.43.34.mov
https://codesandbox.io/p/sandbox/react-aria-popover-placement-57fhmq
🤔 Expected Behavior?
The Popover
should only flip when there's not enough room to render the content.
😯 Current Behavior
The Popover
component flips even when there's space to render the scrollable content.
I included a 1px margin at the top of the Button
so there's more space above the component now. As the Popover
can't render the full content it switches to the axis that has more space.
💁 Possible Solution
From what I can tell calculatePositionInternal
doesn't take the maxHeight
prop into account.
🖥️ Steps to Reproduce
- Render a
Select
with aPopover
that has amaxHeight
prop. - Open the
Select
and notice how theplacement
prop is not respected.
Version
1.7.0
What browsers are you seeing the problem on?
Chrome
What operating system are you using?
macOS 15.3.1