-
Notifications
You must be signed in to change notification settings - Fork 33
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
InfoWindow: closeclick does not get propagated #51
Comments
On a side note: Clicking the "x" still closes the InfoWindow. So you have to make sure, that your opened state gets false in your @closeclick method. I'm not sure if this can be prevented somehow. But my understanding would be:
What I would expect can be done by further extending my addListener:
So while the InfoWindow itself is being closed, it is re-opened instantly. If the opened prop is being changed, this will actually close the InfoWindow (using the watcher/_openInfoWindow() method). But I really don't know if I'm causing any more mess by this. In case this somehow makes sense, I'd be happy to provide a PR. |
Hello! Sorry for being late ): Thanks for reporting! You can try to open your PR and we could try to see if someone can help us testing it :) Edit: in the worst case this can be a optional feature (or props) for those who want to keep it how it is now. |
Hi, no worries about the timing and thanks for the effort :) Optional might be a good idea in case other projects rely on the current behavior. |
#52 is now merged, I'm closing this one. If someone gets affected and wants to help us improve this situation let us know! |
Hey everyone,
this is all quite new to me, so I might be completely mistaken, but it appears to me, that the infoWindow does not propagate its ("native" google maps) closeclick event properly.
I'm using vue-google-maps-community-fork in a quasar (2.11.5) environment which generally works. However I noticed that when clicking the "x" of an InfoWindow, this window disappears but my @closeclick method is not being triggered. No idea if that has something to do with my environment or if I'm missing anything else here.
I added the following line to the afterCreate() hook of infoWindow.vue:
this.$infoWindowObject.addListener('closeclick', () => { this.$emit('closeclick') })
which seems to help with this issue: Clicking the "x" now triggers my @closeclick.
There is a slight drawback however, my (parent component) method for @closeclick will unset the "opened" property of an InfoWindow, therefore the watcher will be triggered and _openInfoWindow() will emit a second "closeclick". Which isn't nice but better than before.
From my understanding the this.$emit('closeclick') in the _openInfoWindow() method does not make too much sense there anyway, at least when I expect this to trigger only when I actually clicked close and not also when I (externally) set my opened prop to false. But that may be as well me misunderstandingthe concept.
Can you confirm this behavior? Or, otherwise, do you have any hints what I might be doing wrong?
The text was updated successfully, but these errors were encountered: