Pārlūkot izejas kodu

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

Vanessa 10 mēneši atpakaļ
vecāks
revīzija
97eb7de2c3

+ 2 - 1
app/src/assets/scss/business/_av.scss

@@ -14,7 +14,8 @@
   }
 
   &__container {
-    overflow: auto;
+    overflow-x: auto;
+    overflow-y: hidden;
     cursor: auto;
   }
 

+ 7 - 6
app/src/protyle/render/av/cell.ts

@@ -306,6 +306,12 @@ export const cellScrollIntoView = (blockElement: HTMLElement, cellElement: Eleme
             }
         }
     }
+    /// #if MOBILE
+    const contentElement = hasClosestByClassName(blockElement, "protyle-content", true);
+    if (contentElement) {
+        contentElement.scrollTop = contentElement.scrollTop + cellRect.top - 110;
+    }
+    /// #else
     if (!blockElement.querySelector(".av__header")) {
         // 属性面板
         return;
@@ -336,6 +342,7 @@ export const cellScrollIntoView = (blockElement: HTMLElement, cellElement: Eleme
             }
         }
     }
+    /// #endif
 };
 
 export const getTypeByCellElement = (cellElement: Element) => {
@@ -365,13 +372,7 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type
     }
     let cellRect = cellElements[0].getBoundingClientRect();
     const contentElement = hasClosestByClassName(blockElement, "protyle-content", true);
-    /// #if MOBILE
-    if (contentElement) {
-        contentElement.scrollTop = contentElement.scrollTop + cellRect.top - 110;
-    }
-    /// #else
     cellScrollIntoView(blockElement, cellElements[0], false);
-    /// #endif
     cellRect = cellElements[0].getBoundingClientRect();
     let html = "";
     let height = cellRect.height;