Vanessa 2025-03-26 10:54:25 +08:00
parent 69642e3bac
commit 40dee11782

View file

@ -701,6 +701,15 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
scrollCenter(protyle, foldElement);
event.stopPropagation();
event.preventDefault();
} else {
// 修正光标上移至 \n 结尾的块时落点错误 https://github.com/siyuan-note/siyuan/issues/14443
const prevEditableElement = getContenteditableElement(previousElement) as HTMLElement;
if (prevEditableElement && prevEditableElement.innerText.endsWith("\n")) {
focusBlock(previousElement, undefined, false);
scrollCenter(protyle, previousElement);
event.stopPropagation();
event.preventDefault();
}
}
}
}