vitmalina / w2ui

UI widgets for modern apps. Data table, forms, toolbars, sidebar, tabs, tooltips, popups. All under 120kb (gzipped).
http://w2ui.com
MIT License
2.64k stars 730 forks source link

Single grid search sends two identical requests #2471

Closed dv1x3r closed 8 months ago

dv1x3r commented 8 months ago

Short description Incorrect w2grid search behaviour.

What is current behaviour Submitting the search with Enter key sends two identical fetch requests.

What is desired behaviour There should be only one request to the server.

Link to jsfidle/codepan with sample code https://jsfiddle.net/jskhbper/8/

Steps to reproduce or sample

  1. Open the browser development tools, and navigate to the Network tab to see outgoing requests.
  2. Submit any search query using the grid toolbar.

The place to check I think the following 'changed' and 'keyup' events call the search function at the same time. https://github.com/vitmalina/w2ui/blob/5876145924e5fbf9ab0d687de3745a814bb58fb3/src/w2grid.js#L6403C34-L6403C34