Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

414
Visualizações
Require minimum filter input length with TomSelect (like select2's minimumInputLength)

I have a webpage with a multi-select field for names, and to prevent biases, I want to only show list entries to users after they have entered at least 3 characters into the filter/search field.

Select2 supports this using the minimumInputLength setting (jsbin)

What would be the best way to achieve this with TomSelect? jsbin-template for tomselect here

Their documentation lists the shouldLoad setting as a possibility, with this explanation:

Use the shouldLoad() callback to implement minimum input length or other input validation. If the callback returns false, load() will not be called and the not_loading template will be added to the dropdown instead of the loading or no_results templates.

However, it seems that shouldLoad only limits whether load() will be called to fetch additional results from the remote resource, but any results that are already available will always be shown, no matter what shouldLoad returns (jsbin mre).

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda