Vuetify: 1.4.3
Vue: 2.5.22
Browsers: Chrome 71.0.3578.98
OS: Linux x86_64
define a prefix filter for VAutocomplete like this:
methods: {
filter: (item, queryText, itemText) => itemText.startsWith(queryText)
}
suppose, items containing values, some of which are the prefix for others
data() {
return {
items: ["bar", "baz", "foo", "foo-bar", "foo-baz", "foo-foo"],
val: ""
};
}
in this example "foo" is the prefix for "foo-bar", "foo-baz", "foo-foo")
If for such autocomplete element first select "foo", so that the value will be "foo", then edit the input to "fo" and then to "foo" again, then suggested items are incorrect: all of items (unfiltered) are shown and none of them is highlighted.
Instead of all items just items, which prefixed by "foo" must be shown.
But the item list is not filtered and none of items is highlighted.
https://codesandbox.io/s/32xn42o03q
The issue occurs due to the check (this.internalSearch !== this.getText(this.selectedItem)) in the function isSearching of components/VAutocomplete/VAutocomplete.js at the line 120:
isSearching: function isSearching() {
if (this.multiple) return this.searchIsDirty;
return this.searchIsDirty && this.internalSearch !== this.getText(this.selectedItem);
}
I may go ahead and give this one a shot
After further discussion with the team / community. The PR that altered this is being considered breaking. Re-opening.
I can give this another go and put behind a prop. Are there any suggestions/preferred naming to use here?
Most helpful comment
I may go ahead and give this one a shot