everweij / react-laag

Hooks to build things like tooltips, dropdown menu's and popovers in React
https://www.react-laag.com
MIT License
906 stars 44 forks source link

[BUG] - Popover not sticking to div element on Google Maps (might not be bug) #88

Open asdutoit opened 2 years ago

asdutoit commented 2 years ago

Describe the bug Hi Guys, I am using Nextjs 12 with Google Maps. I am wondering if I can use the React-laag Popover element with a map marker.

I have managed to create the marker and on invoking an onClick function, the popover appears. But when panning the map, the popover element does not stay with the marker.
It is very possible that this is not a bug but merely the incorrect application of this utility.

Working Example is available at Codesandbox: Click Here

Expected behaviour The Popover element should stick to the div element (for example the marker or button) when panning the maps.

Screenshots Screenshot 2022-06-30 at 12 36 59 Screenshot 2022-06-30 at 12 37 05 (2)

Additional context I have noticed weird behaviour with Markers and OverlayViews on React version 18. Not sure if it could be related. To experience this behaviour, click on the map marker with-OverlayView and pan the map.