-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Labels
Description
🐛 Bug Report
useOverlayPosition
has wrong position when boundary element is set.
🤔 Expected Behavior
It should position overlay correctly.
😯 Current Behavior
Overlay has wrong position.
💁 Possible Solution
Seems like available space and possibly other values are being calculated relative to the body/viewport rather than boundary element. This might only happen if trigger element is within boundary, but not sure.
🔦 Context
In our use case aria overlays need to be fully contained within parent component. Which means portals are attached to that dom node and overlay should be positioned relative to the node.
💻 Code Sample
This is the simplest reproduction I could make based on example in overlay docs.
https://codesandbox.io/s/overlay-position-issue-ysgcsr?file=/src/index.js
maurobalbi