Vuetify Version: 2.1.7
Vue Version: 2.6.10
Browsers: Chrome 77.0.3865.120
OS: Windows 10
Create an autocomplete and set its items to an array of objects as a result of a search.
The search method should be called once
Its is called infinitely
https://codepen.io/Alex83690/pen/RwwZGvL
To avoid this problem, the event "@update:search-input" must not be triggered when the input changes because the user has selected an option
The temporary solution that I use and that I do not like:
search(term) {
let match = this.item && this.selected ? this.items.find((item) => { return item.id === this.selected }) : null
if((match && match.text === term) || typeof term !== 'string' || term.trim() === '') {
return
}
// Start the search
}
A simpler workaround is to use :search-input.sync and set a watcher on the data property instead of using the update method directly.
I've been struggling with this error for about 3 hours now 馃槙
And I can't find a workaround that solves my problem