components
components copied to clipboard
bug(google-maps): Warning in Console about adding Event-Listener for click instead of gmp-click
Is this a regression?
- [x] Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
I'm getting the following warning in console when I use @angular/[email protected]:
<gmp-advanced-marker>: Please use addEventListener('gmp-click', ...) instead of addEventListener('click', ...).
Would this mean the following code should be changed to gmp-click as suggested in the warning?
https://github.com/angular/components/blob/1b721a03faca95636d202660167ff35c2399bdfb/src/google-maps/map-advanced-marker/map-advanced-marker.ts#L136
Reproduction
Create a project that uses the (mapClick)-Output on a <map-advanced-marker>
Expected Behavior
No warning in console.
Actual Behavior
Warning in console.
Environment
- Angular: 19.2.1
- CDK/Material: 19.2.2
- Google-Maps: 19.2.2
- Browser(s): Chrome
- Operating System: Windows
Hmm interesting, something along these lines came up for #30420 and we couldn't use addEventListener, because it was only available in the beta channel of the Maps API.
Playing with it a bit more, even when using addEventListener('gmp-click') it behaves weirdly. The handler doesn't get fired and it still logs some warning from the clusterer.
Hello,
I’m experiencing the same issue with <gmp-advanced-marker> in @angular/[email protected].
My setup:
- Angular version: 19.1.3
- @angular/google-maps version: 19.2.2
-
- Browser: Chrome
I'm experiencing the same issue on a Nuxt app using google maps. Even though I don't use .addListener("click",
I still get those warnings.
I'm getting the same issue in Vue3 using [email protected]. I'm also not using .addListener("click", ...).
same
Add me to the list!