From 78ba07bd561eb97705aeb09f7f2a84f1e5e18730 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 7 Oct 2024 23:15:36 +0800 Subject: [PATCH] :bug: https://github.com/siyuan-note/siyuan/issues/12710 --- app/src/protyle/wysiwyg/keydown.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index 969c56c4e28..8473ee03b59 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -671,7 +671,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { if (previousElement) { const foldElement = hasClosestByAttribute(previousElement, "fold", "1") as HTMLElement; // 代码块或以软换行结尾的块移动光标 ↑ 会跳过 https://github.com/siyuan-note/siyuan/issues/5498 - if (!foldElement) { + // 代码块全选后 ↑ 光标不会上移 https://github.com/siyuan-note/siyuan/issues/11581 + // 段落块不能设置,否则 ↑ 后光标位置不能保持 https://github.com/siyuan-note/siyuan/issues/12710 + if (!foldElement && previousElement.classList.contains("code-block")) { focusBlock(previousElement, undefined, false); scrollCenter(protyle, previousElement); event.stopPropagation();