Closed thisisobate closed 2 years ago
same error
This is react-popper
v1 which hasn't had a bug fix since 2019... Popper v2 was released in January 2020 and doesn't have this issue: https://codesandbox.io/s/react-popper-dropdown-issue-forked-4qebw2
How were you using v1?
Actually I think you're facing this bug: https://github.com/floating-ui/floating-ui/issues/1404 which is indeed still an issue in Popper v2.
The first (root) menu opens correctly in Popper v2 (unlike v1) but the submenu requires 2 updates. The bug isn't present in Floating UI though.
Reproduction demo
https://codesandbox.io/s/react-popper-dropdown-issue-7g04f
Steps to reproduce the problem
What is the expected behavior?
Popper should extend and fit in within available viewport.
What went wrong?
We use React popper to place elements in different postions within our screen. On hover, react popper shows a dropdown that contains nested dropdowns. If the popper was placed within the lower section of the screen, we notice that extending these dropdowns causes the popper to vanish off the screen. We suspect that the cause of the issue is that popper fails to recalculate its height given the current viewport. We feel its never an issue with placements or data, but with popper's height value.
Any other comments?
Packages versions