From 5823f802de1a668d09a5457899243836dedaf6e5 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 15 Sep 2024 22:27:04 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/12162 --- app/src/protyle/render/av/cell.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index c6b0f1733d4..df87cc34c97 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -293,9 +293,11 @@ export const cellScrollIntoView = (blockElement: HTMLElement, cellElement: Eleme if (rowElement) { const stickyElement = rowElement.querySelector(".av__colsticky"); 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) { avScrollElement.scrollLeft = avScrollElement.scrollLeft + cellRect.left - avScrollRect.left;