From 851535f418ffc3537261d8b659f30507ab28717f Mon Sep 17 00:00:00 2001 From: Rob Ryan Date: Wed, 25 Aug 2021 11:13:11 +1000 Subject: [PATCH] Don't clear the when keyup event is fired for SHIFT This avoids the common case where shift is held down to enter uppercase characters and then is quickly released after the last character. Previously this would clear the timer and not update the suggestions. --- magicsuggest.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/magicsuggest.js b/magicsuggest.js index e607a71..a78423c 100644 --- a/magicsuggest.js +++ b/magicsuggest.js @@ -653,6 +653,7 @@ BACKSPACE: 8, TAB: 9, ENTER: 13, + SHIFT: 16, CTRL: 17, ESC: 27, SPACE: 32, @@ -1394,7 +1395,9 @@ $(ms).trigger('keyup', [ms, e]); - clearTimeout(_timer); + if(e.keyCode !== KEYCODES.SHIFT) { + clearTimeout(_timer); + } // collapse if escape, but keep focus. if (e.keyCode === KEYCODES.ESC && cfg.expanded) {