From dc77b3f17f8a796e19b54331263fa51fd29a9c25 Mon Sep 17 00:00:00 2001 From: Dominik Reh Date: Wed, 26 Oct 2022 15:20:06 +0200 Subject: [PATCH] Configurable debounce delay Workaround for the problem in #40 --- javascript/tagAutocomplete.js | 2 +- tags/config.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/javascript/tagAutocomplete.js b/javascript/tagAutocomplete.js index 14b7054..8f4c54e 100644 --- a/javascript/tagAutocomplete.js +++ b/javascript/tagAutocomplete.js @@ -672,7 +672,7 @@ onUiUpdate(function () { hideResults(area); // Add autocomplete event listener - area.addEventListener('input', debounce(() => autocomplete(area, area.value), 100)); + area.addEventListener('input', debounce(() => autocomplete(area, area.value), acConfig.delayTime)); // Add focusout event listener area.addEventListener('focusout', debounce(() => hideResults(area), 400)); // Add up and down arrow event listener diff --git a/tags/config.json b/tags/config.json index 3871b08..2f5a3fa 100644 --- a/tags/config.json +++ b/tags/config.json @@ -7,6 +7,7 @@ }, "maxResults": 5, "resultStepLength": 500, + "delayTime": 100, "showAllResults": false, "useLeftRightArrowKeys": false, "replaceUnderscores": true,