[IMP] filtering: Prevent duplicate search triggered on text input change#919
[IMP] filtering: Prevent duplicate search triggered on text input change#919emullaraj wants to merge 4 commits intostwe:masterfrom
Conversation
|
Is it necessary to keep |
|
@Seb33300 I see your point. I tested the results without the Mozilla says this about
Whereas the
So there is a difference. :) Is there any case when removing |
|
Of course there is a difference, but I think we should trigger the search only if search value changed. Triggering search when pressing buttons like arrows, pg up/down, etc... is useless |
Updated PR |
This is a low priority old bug that I was trying to track down when having a little bit of time where a second search is triggered after filtering one column and hitting an action button/link. This is mainly caused by the change event on the input, which makes the evaluation after the input loses the focus (user click the action link). The user is forced to click the action once again as the datatable reloads the same results as the previous search.
Use case to reproduce the issue:
Fix search.js.twig
Before:
$(selector + '-filterrow').find("input.sg-datatables-individual-filtering").on("keyup change", search);After:
$(selector + '-filterrow').find("input.sg-datatables-individual-filtering").on("keyup input", search);By switching the "change" event with the "input" event, mobile users would also experience the same behaviour as desktop users where search trigger will be evaluated after each button click on the virtual keyboard.