mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
autocomplete address when importing exact place
This commit is contained in:
parent
00e8e0bd37
commit
fed4f7d3ec
1 changed files with 11 additions and 4 deletions
|
@ -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 })
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue