Always reset #wordsInput with layout emulator (#1960)

This commit is contained in:
SeerLite 2021-10-07 10:33:42 -03:00 committed by GitHub
parent 6d9b28c1ca
commit 57f6eec430
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}
});