What is the example you wish to see?
Anchor a react component to a specific element, without requiring the user to scroll first.
Is there any context that might help us understand?
For the documentation of getOverlayAnchor(), it states:
getOverlayAnchor first listens to the current window's scroll event. On each scroll event, it uses the getBoundingClientRect function to calculate the absolute position of the target element. Then, it applies the calculated position to the container used to mount your component.
This results in my UI element first appearing at the top left of the page - and only when the user scrolls, the component rightly appears at the position I need it to be.
However, I don't anticipate my users scrolling the page - how can I go about ensuring that the react component shows up exactly where I want it to? Is the function that calculates the position exported for us to reuse and call when we want to? Or is there a different approach to take here.
Code of Conduct
What is the example you wish to see?
Anchor a react component to a specific element, without requiring the user to scroll first.
Is there any context that might help us understand?
For the documentation of
getOverlayAnchor(), it states:This results in my UI element first appearing at the top left of the page - and only when the user scrolls, the component rightly appears at the position I need it to be.
However, I don't anticipate my users scrolling the page - how can I go about ensuring that the react component shows up exactly where I want it to? Is the function that calculates the position exported for us to reuse and call when we want to? Or is there a different approach to take here.
Code of Conduct