mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-08 22:50:00 +08:00
added check so that caret position defaults to last letter in word if currentInput is longer
This commit is contained in:
parent
01e98fcf78
commit
9a27979d85
1 changed files with 6 additions and 2 deletions
|
@ -1424,9 +1424,13 @@ function updateCaretPosition() {
|
|||
currentLetterIndex = 0;
|
||||
}
|
||||
try {
|
||||
let currentLetter = document
|
||||
let currentWordNodeList = document
|
||||
.querySelector("#words .active")
|
||||
.querySelectorAll("letter")[currentLetterIndex];
|
||||
.querySelectorAll("letter");
|
||||
let currentLetter = currentWordNodeList[currentLetterIndex];
|
||||
if (inputLen > currentWordNodeList.length) {
|
||||
currentLetter = currentWordNodeList[currentWordNodeList.length - 1];
|
||||
}
|
||||
|
||||
if ($(currentLetter).length == 0) return;
|
||||
const isLanguageLeftToRight = currentLanguage.leftToRight;
|
||||
|
|
Loading…
Add table
Reference in a new issue