mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-23 00:36:10 +01:00
This commit is contained in:
parent
69642e3bac
commit
40dee11782
1 changed files with 9 additions and 0 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue