Browse Source

:art: https://github.com/siyuan-note/siyuan/issues/12278

Vanessa 8 months ago
parent
commit
3736319e51
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/src/util/highlightById.ts

+ 1 - 1
app/src/util/highlightById.ts

@@ -47,7 +47,7 @@ export const scrollCenter = (protyle: IProtyle, nodeElement?: Element, top = fal
             if (blockElement.classList.contains("code-block")) {
             if (blockElement.classList.contains("code-block")) {
                 const brElement = document.createElement("br");
                 const brElement = document.createElement("br");
                 range.insertNode(brElement);
                 range.insertNode(brElement);
-                brElement.scrollIntoView({block: "center", behavior});
+                brElement.scrollIntoView({block: "nearest", behavior});
                 brElement.remove();
                 brElement.remove();
                 return;
                 return;
             }
             }