mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 19:41:05 +08:00
This commit is contained in:
parent
8ed198b0e7
commit
708d32b668
@ -704,11 +704,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||
} 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();
|
||||
if (prevEditableElement && prevEditableElement.lastChild.nodeType === 3 &&
|
||||
prevEditableElement.lastChild.textContent.endsWith("\n")) {
|
||||
prevEditableElement.lastChild.textContent = prevEditableElement.lastChild.textContent.replace(/\n$/, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user