Attempt to fix closeclick issue in InfoWindow

- propagate google maps InfoWindow's closeclick event to the parent component
  however, re-open the InfoWindow to ensure, its state is set solely by
  the opened prop of the InfoWindow component
- do not emit closeclick in the _openInfoWindow() method triggered by
  the watcher on the opened prop. closeclick should only be triggered,
  when the user atually clicked close
This commit is contained in:
Oliver Kirsch
2023-02-15 08:36:36 +01:00
parent eb70f3ccd4
commit 0ea377c29a

View File

@@ -67,14 +67,16 @@ export default buildComponent({
this.$infoWindowObject.close()
if (this.opened) {
this.$infoWindowObject.open(this.$map, this.$markerObject)
} else {
this.$emit('closeclick')
}
},
},
afterCreate() {
this._openInfoWindow()
this.$infoWindowObject.addListener('closeclick', () => {
this.$emit('closeclick')
this.$infoWindowObject.open(this.$map, this.$markerObject)
})
this.$watch('opened', () => {
this._openInfoWindow()
})