I've been trying to find how to fire a form submission when a completion is clicked with places autocomplete, but I cannot figure this out.
I have a custom method placeChanged which I'm calling with
this.autocomplete.addListener('place_changed', this.placeChanged)
and the method is as follows
placeChanged() {
this.place = this.autocomplete.getPlace()
const addressComponents = this.place.address_components
if (addressComponents !== undefined) {
const formattedAddress = this.formatAddressComponents(addressComponents)
this.setAddressComponents(formattedAddress)
}
if (this.place.geometry !== undefined) {
this.setGeometry(this.place.geometry)
}
}
the form will submit upon clicking enter, but I would like it to submit whenever I choose a completion form the list so that I could get rid of the 'submit' button on my form. How can I achieve this? The docs doesn't cover this at all.