fix: ctrl+backspace replay bug (ashinberish)

This commit is contained in:
Ashin Berish 2024-02-26 18:08:41 +05:30 committed by GitHub
parent 2ff0c60072
commit 5ff0c3fdec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1332,7 +1332,12 @@ $("#wordsInput").on("input", (event) => {
TestUI.updateWordElement();
void Caret.updatePosition();
if (!CompositionState.getComposing()) {
Replay.addReplayEvent("setLetterIndex", currTestInput.length - 1);
const keyStroke = event?.originalEvent as InputEvent;
if (keyStroke.inputType === "deleteWordBackward") {
Replay.addReplayEvent("setLetterIndex", 0); // Letter index will be 0 on CTRL + Backspace Event
} else {
Replay.addReplayEvent("setLetterIndex", currTestInput.length - 1);
}
}
}
if (inputValue !== currTestInput) {