slim-select
slim-select copied to clipboard
Ajax with minimal search length
In the ajax option, also on the demo page (https://slimselectjs.com/options) in the search field 'Search "Graham"':
- When you search for 'gra' > You get results
- Remove the 'a' > You get 'Need 3 characters'
- Add the 'a' again > You don't get any results
I dug into the code and I believe that this was caused by the following code
SlimSelect.prototype.search = function (value) {
if (this.data.searchValue === value) {
return;
}
This is because the this.data.searchValue value still is 'gra'.
I've fixed this quickly:
SlimSelect.prototype.search = function (value) {
this.data.searchValue = ''; //fix
if (this.data.searchValue === value) {
return;
}
New version released today! Check it out and if you still have an issue let me know.