You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On version 1.4.2, the InfoWindow automatically closes when the map is moved. Which is particularly annoying because when an InfoWindow is not entirely in the viewport, the map is automatically moved in order to fully show the infowindow, which means that the InfoWindow is opened then instantly closed.
Looking at it, I can see that the onClose event is triggered whenever the map is being moved.
I don't know if this is relevant, but I'm using the infowindow on an advancermarker and there are also clusters on the map.
On version 1.1.3, everything works fine. When opening the InfoWindow, it stays open. When moving the map, it stays open.
Hi @Bcavez, thanks for taking the time to report the issue! It looks like a bug indeed.
At first glance it seems that this effect (https://github.com/visgl/react-google-maps/blob/main/src/components/info-window.tsx#L175-L235) is triggered more often than it should and thus calling infowindow.close() which then triggers the onClose event. The fix should be pretty straight forward. Maybe even just replacing useEffect with useDeepCompareEffect
Description
On version 1.4.2, the InfoWindow automatically closes when the map is moved. Which is particularly annoying because when an InfoWindow is not entirely in the viewport, the map is automatically moved in order to fully show the infowindow, which means that the InfoWindow is opened then instantly closed.
Looking at it, I can see that the onClose event is triggered whenever the map is being moved.
I don't know if this is relevant, but I'm using the infowindow on an advancermarker and there are also clusters on the map.
On version 1.1.3, everything works fine. When opening the InfoWindow, it stays open. When moving the map, it stays open.
Steps to Reproduce
First case:
Second case:
Environment
Logs
No response
The text was updated successfully, but these errors were encountered: