Verified Commit fed4f7d3 authored by les's avatar les
Browse files

autocomplete address when importing exact place

parent 00e8e0bd
......@@ -76,10 +76,17 @@ export default {
this.disableAddress = true
} else { // this is a new place
this.place.name = p.name || p
this.place.address = ''
this.disableAddress = false
this.$refs.place.blur()
this.$refs.address.focus()
// search for a place with the same name
const place = this.places.find(p => p.name === this.place.name)
if (place) {
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 })
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment