Fiction Function
Fiction Function

Reputation: 1

How to set loadThrottle 0 when using default load() function in tom-select

I need tom-select to refresh options with new query on every keydown. But it seems loadThrottle setting doesn't work without custom load() function. Is there any way to make loadThrottle 0 when using default load() function ? Here's my code.

new TomSelect("#select-tags",{
                    loadThrottle: 0,
                    plugins: ['remove_button'],
                    onItemAdd:function(){
                      this.setTextboxValue('');
                      this.refreshOptions();
                    },
                    render:{
                      option:function(data,escape){
                        return '<div class="d-flex"><span>' + escape(data.value) + '</span></div>';
                      },
                      item:function(data,escape){
                        return '<div>' + escape(data.value) + '</div>';
                      }
                    },
                  });

I tried to set custom load function, but I wasn't able to reproduce the default custom load function with it...

Upvotes: 0

Views: 60

Answers (0)

Related Questions