Browse Source

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

Vanessa 9 months ago
parent
commit
5823f802de
1 changed files with 5 additions and 3 deletions
  1. 5 3
      app/src/protyle/render/av/cell.ts

+ 5 - 3
app/src/protyle/render/av/cell.ts

@@ -293,9 +293,11 @@ export const cellScrollIntoView = (blockElement: HTMLElement, cellElement: Eleme
                 if (rowElement) {
                 if (rowElement) {
                     const stickyElement = rowElement.querySelector(".av__colsticky");
                     const stickyElement = rowElement.querySelector(".av__colsticky");
                     if (stickyElement) {
                     if (stickyElement) {
-                        const stickyRight = stickyElement.getBoundingClientRect().right;
-                        if (stickyRight > cellRect.left) {
-                            avScrollElement.scrollLeft = avScrollElement.scrollLeft + cellRect.left - stickyRight;
+                        if (!stickyElement.contains(cellElement)) { // https://github.com/siyuan-note/siyuan/issues/12162
+                            const stickyRight = stickyElement.getBoundingClientRect().right;
+                            if (stickyRight > cellRect.left) {
+                                avScrollElement.scrollLeft = avScrollElement.scrollLeft + cellRect.left - stickyRight;
+                            }
                         }
                         }
                     } else if (avScrollRect.left > cellRect.left) {
                     } else if (avScrollRect.left > cellRect.left) {
                         avScrollElement.scrollLeft = avScrollElement.scrollLeft + cellRect.left - avScrollRect.left;
                         avScrollElement.scrollLeft = avScrollElement.scrollLeft + cellRect.left - avScrollRect.left;