hypothesis / hypothesis/frontend-shared
Make sure `Popover` does not render outside the viewport's y axis
- Dominant language
- TypeScript
- Stars
- 8
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Some time ago we [implemented some logic](https://github.com/hypothesis/frontend-shared/pull/1746) to make sure the Popover never spanned outside of the x axis of the viewport, causing a lot of horizontal scroll.
The popover also has some logic to drop up of the anchor element instead of down, if there's not enough space below. However, this logic does not take into consideration that there could also not be enough space above either, so the popover cannot be fully displayed.
We should add some extra logic that ensures the popover is conditionally displayed above or below, but based on where there's more available space. Then we should set a max height that makes scroll to be rendered, preventing part of the popover content to be cropped.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.