kilbot / WooCommerce-POS

:bangbang: All development now at https://github.com/wcpos.
http://wcpos.com
GNU General Public License v3.0
353 stars 125 forks source link

Delay between api calls/requests #147

Closed hieu-n closed 7 years ago

hieu-n commented 7 years ago

WooCommerce-POS nearly sends an api request to the server for every character I input into the search bar. Are there a setting or lines in code that I can change to delay between search requests?

thomasmery commented 7 years ago

Hi Hieu,

I believe the key strokes are buffered and sent every 150ms at the moment.

This is a hard coded value but if you are able to re-build the client js app you can change this value here:

https://github.com/kilbot/WooCommerce-POS/blob/master/assets/js/src/lib/behaviors/filter.js#L61

if you are using the Pro Version of the plugin be aware that changing this value will affect all search fields (in the Products screen for instance)

@kilbot will be able to be more precise if needed I'm sure

hope this helps