소스 검색

:bug: https://github.com/siyuan-note/siyuan/issues/12710

Vanessa 9 달 전
부모
커밋
78ba07bd56
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      app/src/protyle/wysiwyg/keydown.ts

+ 3 - 1
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();