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:
@@ -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()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user