#Popover Positioning

2 messages · Page 1 of 1 (latest)

stark granite
#

I want my popover to have the defualt position of "bottom-end" however if it ever ends up outside the viewport I want it to use a different direction that works. This works find for switching between bottom and top however if both top and bottom would cause it to leave the viewport it doesn't try left or right.

I tried to achieve this manually by adding a ref to the root component in Popover.Dropdown and using it to check the position and adjust if necessary. However I found that I can't get a ref for elements that are inside Poppover.dropdown and it also does not expose its ref.

What's the best way to achive the desired behavior?

gilded solar