[popover] Add a `sticky` / `lockSideOnOpen` prop
- Dominant language
- TypeScript
- Stars
- 10.9k
- Forks
- 543
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 101
Description
# Feature request
## Summary
In the default popover logic, when the popover doesn't have enough space it will flip to the opposite side. This works great until you have a dynamic popover which will change its options. This can result in janky behaviour that although is working as intended, looks jarring to the user.
In the below video, the popover starts out above the button (intended, given no space), opening sub-menus then moves it back to the bottom. Intended behaviour by the library given there is space available, however this is extremely janky and confusing UX.
https://github.com/user-attachments/assets/f686dbbc-5c24-41e1-9101-922e7147c00b
## Motivation
It would be great if we could have a `sticky` / `lockSideOnOpen` behaviour for the collision, so the popover keeps its initial position (or at least, uses a consistent "preferred" side). In the above video, I would love if it kept to the top given that is the position it started with.
Hope that clarifies, thank you!
Contributor guide
Assessment
This issue has not been assessed yet.