Procházet zdrojové kódy

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

Vanessa před 2 roky
rodič
revize
e68e608470
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 4 4
      app/src/util/backForward.ts

+ 4 - 4
app/src/util/backForward.ts

@@ -91,7 +91,7 @@ const focusStack = async (stack: IBackStack) => {
                             return true;
                             return true;
                         }
                         }
                     });
                     });
-                    focusByOffset(blockElement, stack.position.start, stack.position.end);
+                    focusByOffset(getContenteditableElement(blockElement), stack.position.start, stack.position.end);
                     scrollCenter(protyle, blockElement);
                     scrollCenter(protyle, blockElement);
                 }
                 }
             }, 500);
             }, 500);
@@ -125,7 +125,7 @@ const focusStack = async (stack: IBackStack) => {
             return true;
             return true;
         }
         }
         if (blockElement && !stack.protyle.block.showAll) {
         if (blockElement && !stack.protyle.block.showAll) {
-            focusByOffset(blockElement, stack.position.start, stack.position.end);
+            focusByOffset(getContenteditableElement(blockElement), stack.position.start, stack.position.end);
             scrollCenter(stack.protyle, blockElement, true);
             scrollCenter(stack.protyle, blockElement, true);
             return true;
             return true;
         }
         }
@@ -142,7 +142,7 @@ const focusStack = async (stack: IBackStack) => {
                     return true;
                     return true;
                 }
                 }
             });
             });
-            focusByOffset(blockElement, stack.position.start, stack.position.end);
+            focusByOffset(getContenteditableElement(blockElement), stack.position.start, stack.position.end);
             setTimeout(() => {
             setTimeout(() => {
                 // 图片、视频等加载完成后再定位
                 // 图片、视频等加载完成后再定位
                 scrollCenter(stack.protyle, blockElement, true);
                 scrollCenter(stack.protyle, blockElement, true);
@@ -177,7 +177,7 @@ const focusStack = async (stack: IBackStack) => {
                     return true;
                     return true;
                 }
                 }
             });
             });
-            focusByOffset(blockElement, stack.position.start, stack.position.end);
+            focusByOffset(getContenteditableElement(blockElement), stack.position.start, stack.position.end);
             setTimeout(() => {
             setTimeout(() => {
                 scrollCenter(stack.protyle, blockElement);
                 scrollCenter(stack.protyle, blockElement);
             }, Constants.TIMEOUT_INPUT);
             }, Constants.TIMEOUT_INPUT);