-
Notifications
You must be signed in to change notification settings - Fork 522
Open
Description
I have another suggestion.
With a very long list of options (or with an Ajax call), and with only one or two characters entered the filtered results can still be long and meaningless.
I have managed to delay the search until you enter at least 3 characters by simulating Ajax:
<treeselect v-model="mapZone" @input="changeMap" :open-on-click="false"
async :load-options="searchMapZone" retry-text=""
clear-on-select placeholder="Change Map or Zone..."/>
</treeselect>searchMapZone: function({action, searchQuery, callback}) {
if (searchQuery.length<3) return callback('Please keep typing...', []);
searchQuery = searchQuery.toLowerCase();
callback(null, this.mapsZones.filter(function(item) {
return item.label.toLowerCase().indexOf(searchQuery)!=-1;
}));
},It would be nice to have a build-in prop :min-chars="3" to require a minimum number of characters before the list is searched/displayed.
Thank you for making this awesome module available!
felcerreia, dhduc, patrickcate, warrenspe and cysieks
Metadata
Metadata
Assignees
Labels
No labels