fix(caret): incorrect placement on page load

This commit is contained in:
Miodec 2024-05-29 19:52:41 +02:00
parent b2a8604994
commit 595000ad4f
2 changed files with 4 additions and 2 deletions

View file

@ -1642,7 +1642,7 @@ export function setFontSize(fontSize: number, nosave?: boolean): boolean {
ConfigEvent.dispatch("fontSize", config.fontSize, nosave);
// trigger a resize event to update the layout - handled in ui.ts:108
$(window).trigger("resize");
if (!nosave) $(window).trigger("resize");
return true;
}

View file

@ -356,7 +356,9 @@ export function showWords(): void {
updateWordsWidth();
updateWordsHeight(true);
updateActiveElement(undefined, true);
void Caret.updatePosition();
setTimeout(() => {
void Caret.updatePosition();
}, 125);
updateWordsInputPosition(true);
}