From cc17338d58f56882be66fb59004a647963854403 Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 16 Mar 2021 01:51:04 +0000 Subject: [PATCH] fixed a bug where the caret would reset position after loosing focus or opening the command line. fixes #1105 --- src/js/script.js | 2 +- src/js/test/caret.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/script.js b/src/js/script.js index 9dab71426..32265adc7 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -4139,7 +4139,7 @@ $("#wordsInput").on("focus", () => { if (!TestUI.resultVisible && Config.showOutOfFocusWarning) { OutOfFocus.hide(); } - Caret.show(); + Caret.show(currentInput); }); $("#wordsInput").on("focusout", () => { diff --git a/src/js/test/caret.js b/src/js/test/caret.js index 6abd40101..65788f55f 100644 --- a/src/js/test/caret.js +++ b/src/js/test/caret.js @@ -27,9 +27,9 @@ export function hide() { $("#caret").addClass("hidden"); } -export function show() { +export function show(currentInput) { if ($("#result").hasClass("hidden")) { - updatePosition(""); + updatePosition(currentInput); $("#caret").removeClass("hidden"); startAnimation(); }