From 6edffa672b654190944e8d3735f52826b8d8e2b4 Mon Sep 17 00:00:00 2001 From: filifa Date: Thu, 11 Dec 2025 23:49:34 -0500 Subject: [PATCH] fix cursor starting in wrong spot --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index 25f0667..7a80389 100644 --- a/main.js +++ b/main.js @@ -175,7 +175,7 @@ function keyPress(c) { const begin = currentInput.value.slice(0, selectionStart); const end = currentInput.value.slice(selectionEnd); currentInput.value = begin + c + end; - currentInput.setSelectionRange(selectionEnd+1, selectionEnd+1); + currentInput.setSelectionRange(selectionStart+1, selectionStart+1); } document.querySelector("#expr").addEventListener("focus", setCurrentInput);