From 57f6eec430ce2ba6f9a3e2f78e9c77b73fc5a6d3 Mon Sep 17 00:00:00 2001 From: SeerLite Date: Thu, 7 Oct 2021 10:33:42 -0300 Subject: [PATCH] Always reset #wordsInput with layout emulator (#1960) --- src/js/input-controller.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js/input-controller.js b/src/js/input-controller.js index 0594dee47..48296d346 100644 --- a/src/js/input-controller.js +++ b/src/js/input-controller.js @@ -399,7 +399,6 @@ function handleChar(char, charIndex) { if (!thisCharCorrect && Misc.trailingComposeChars.test(resultingWord)) { TestLogic.input.current = resultingWord; - setWordsInput(" " + TestLogic.input.current); TestUI.updateWordElement(); Caret.updatePosition(); return; @@ -472,7 +471,6 @@ function handleChar(char, charIndex) { charIndex < TestLogic.words.getCurrent().length + 20) ) { TestLogic.input.current = resultingWord; - setWordsInput(" " + TestLogic.input.current); } if (!thisCharCorrect && Config.difficulty == "master") { @@ -545,7 +543,6 @@ function handleChar(char, charIndex) { Caret.updatePosition(); } - setWordsInput(" " + TestLogic.input.current); } function handleTab(event) { @@ -608,6 +605,7 @@ function handleTab(event) { } else { event.preventDefault(); handleChar("\t", TestLogic.input.current.length); + setWordsInput(" " + TestLogic.input.current); } } else if (!TestUI.resultVisible) { if ( @@ -620,6 +618,7 @@ function handleTab(event) { } else { event.preventDefault(); handleChar("\t", TestLogic.input.current.length); + setWordsInput(" " + TestLogic.input.current); } } } else if (Config.quickTab) { @@ -708,6 +707,7 @@ $(document).keydown((event) => { TestLogic.finish(); } else { handleChar("\n", TestLogic.input.current.length); + setWordsInput(" " + TestLogic.input.current); } } @@ -735,6 +735,7 @@ $(document).keydown((event) => { handleChar(char, TestLogic.input.current.length); updateUI(); } + setWordsInput(" " + TestLogic.input.current); } });