slim-select icon indicating copy to clipboard operation
slim-select copied to clipboard

Ajax with minimal search length

Open tomvanlamoen-bookerz opened this issue 4 years ago • 1 comments

In the ajax option, also on the demo page (https://slimselectjs.com/options) in the search field 'Search "Graham"':

  1. When you search for 'gra' > You get results
  2. Remove the 'a' > You get 'Need 3 characters'
  3. 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'.

tomvanlamoen-bookerz avatar Jun 03 '21 07:06 tomvanlamoen-bookerz

I've fixed this quickly:

SlimSelect.prototype.search = function (value) {
this.data.searchValue = ''; //fix
if (this.data.searchValue === value) {
    return;
}

Pathologic avatar Dec 15 '21 15:12 Pathologic

New version released today! Check it out and if you still have an issue let me know.

brianvoe avatar Nov 20 '22 22:11 brianvoe