twitter / typeahead.js

typeahead.js is a fast and fully-featured autocomplete library
http://twitter.github.io/typeahead.js/
MIT License
16.52k stars 3.21k forks source link

Prevent http request base on custom characters or data types #1796

Closed AyadBarzan-zz closed 3 years ago

AyadBarzan-zz commented 3 years ago

Problem: typeahead always start http request when limit search length is affected , this make a lot of traffic and load of server in my case html input is used to find products from db and to set quantity of added rows by using (+Quantity) , I want a configuration that allow me to specify which datatype must search for , for example I want prevent typeahead from searching for numbers or symbols.

Solution: maybe adding ( datatype ) for configuration is useful. or let users to verify search term and decide that term must be search or not using some function that return term like :beforeRequest(term){ if(Number.isNaN(term) return false; } Screenshot 2020-11-23 132446