Skip to content

Commit

Permalink
fix: ctrl+backspace replay bug (ashinberish)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashinberish committed Feb 26, 2024
1 parent 2ff0c60 commit 5ff0c3f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/ts/controllers/input-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5ff0c3f

Please sign in to comment.