Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior of the information window #3350

Open
alexkobylansky opened this issue Apr 23, 2024 · 4 comments
Open

Strange behavior of the information window #3350

alexkobylansky opened this issue Apr 23, 2024 · 4 comments

Comments

@alexkobylansky
Copy link

alexkobylansky commented Apr 23, 2024

163300
171544

Strange behavior of the information window.
When I click on the marker, a small empty window appears, which should not be.

@AdamZajlerDDH
Copy link

I have the same issue while using it with cluster. It will be nice to see implementaion guide for markers + infowindows + cluster; because i have issue with passing ref from AdvancedMarker to InfoWindow

@ggu
Copy link

ggu commented May 31, 2024

I wrote some dirty client-side code to deal with this issue:

const handleMarkerClick = useCallback((location) => {
    setActiveMarker(location);
    setTimeout(() => {
      const infoWindowElements = document.querySelectorAll('.gm-style-iw, .gm-style-iw-c');
      infoWindowElements.forEach(element => {
        const children = Array.from(element.children);
        if (children.length === 2 && (!children[0].children.length || !children[1].children.length)) {
          element.parentElement.style.display = 'none';
        }
      });
    }, 50);
  }, []);
    ```

@nimlevy
Copy link

nimlevy commented Sep 6, 2024

I'm having the same issue.
@ggu I'm curious about why did you choose to hide the parent element instead of removing it?

@ggu
Copy link

ggu commented Sep 9, 2024

I'm having the same issue.

@ggu I'm curious about why did you choose to hide the parent element instead of removing it?

I can't remember, but should be fine to remove.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants