From 5ff0c3fdec5f419fd26cdbde02c8da1010b5e918 Mon Sep 17 00:00:00 2001 From: Ashin Berish Date: Mon, 26 Feb 2024 18:08:41 +0530 Subject: [PATCH] fix: ctrl+backspace replay bug (ashinberish) --- frontend/src/ts/controllers/input-controller.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/ts/controllers/input-controller.ts b/frontend/src/ts/controllers/input-controller.ts index 066d6a05a..976199370 100644 --- a/frontend/src/ts/controllers/input-controller.ts +++ b/frontend/src/ts/controllers/input-controller.ts @@ -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) {