From de9324eaefcc3dd53163fd30803c2825bdf88e43 Mon Sep 17 00:00:00 2001 From: SandyDatatables Date: Thu, 12 Aug 2021 13:04:10 +0000 Subject: [PATCH] fix: Reduce the number of search events triggered by fuzzy search Jira Issue DD-2083 --- features/fuzzySearch/dataTables.fuzzySearch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/fuzzySearch/dataTables.fuzzySearch.js b/features/fuzzySearch/dataTables.fuzzySearch.js index f1e15db..2a1337d 100644 --- a/features/fuzzySearch/dataTables.fuzzySearch.js +++ b/features/fuzzySearch/dataTables.fuzzySearch.js @@ -296,7 +296,7 @@ // The function that we want to run on search var triggerSearchFunction = function(event){ // If the search is only to be triggered on return wait for that - if (!initial.returnSearch || event.key === "Enter") { + if ((event.type === 'input' && !initial.returnSearch) || event.key === "Enter") { var searchVal = ''; // If the toggle is set and isn't checkd then perform a normal search if(toggle && !toggle.attr('blurred')) { @@ -372,7 +372,7 @@ if(!inToolTip) { removeToolTip(); } - }, 250) + }, 250); }); var state = api.state.loaded();