fix(caret): incorrect placement in tape mode: word

This commit is contained in:
Miodec 2024-08-02 10:50:33 +02:00
parent feaff239f2
commit b22e0a407d

View file

@ -150,7 +150,10 @@ export async function updatePosition(noAnim = false): Promise<void> {
const wordsWrapperWidth =
$(document.querySelector("#wordsWrapper") as HTMLElement).width() ?? 0;
if (Config.tapeMode === "letter") {
if (
Config.tapeMode === "letter" ||
(Config.tapeMode === "word" && inputLen === 0)
) {
newLeft = wordsWrapperWidth / 2 - (fullWidthCaret ? 0 : caretWidth / 2);
}