diff --git a/frontend/src/ts/test/caret.ts b/frontend/src/ts/test/caret.ts index 8a5126b42..a7dc6ddba 100644 --- a/frontend/src/ts/test/caret.ts +++ b/frontend/src/ts/test/caret.ts @@ -130,8 +130,8 @@ export async function updatePosition(noAnim = false): Promise { Config.fontSize * Numbers.convertRemToPixels(1); const letterWidth = - currentLetter?.offsetWidth ?? - previousLetter?.offsetWidth ?? + currentLetter?.offsetWidth || + previousLetter?.offsetWidth || lastWordLetter?.offsetWidth; const diff = letterHeight - caret.offsetHeight;