autocomplete address when importing exact place
This commit is contained in:
@@ -76,10 +76,17 @@ export default {
|
|||||||
this.disableAddress = true
|
this.disableAddress = true
|
||||||
} else { // this is a new place
|
} else { // this is a new place
|
||||||
this.place.name = p.name || p
|
this.place.name = p.name || p
|
||||||
this.place.address = ''
|
// search for a place with the same name
|
||||||
this.disableAddress = false
|
const place = this.places.find(p => p.name === this.place.name)
|
||||||
this.$refs.place.blur()
|
if (place) {
|
||||||
this.$refs.address.focus()
|
this.place.address = place.address
|
||||||
|
this.disableAddress = true
|
||||||
|
} else {
|
||||||
|
this.place.address = ''
|
||||||
|
this.disableAddress = false
|
||||||
|
this.$refs.place.blur()
|
||||||
|
this.$refs.address.focus()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.$emit('input', { ...this.place })
|
this.$emit('input', { ...this.place })
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user