fix cursor starting in wrong spot
This commit is contained in:
2
main.js
2
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);
|
||||
|
||||
Reference in New Issue
Block a user