From c1da1711e649aae13f97c2ba09c3cb25ced1ea05 Mon Sep 17 00:00:00 2001 From: Pedram Amini Date: Sun, 1 Feb 2026 10:13:23 -0500 Subject: [PATCH] fix(file-preview): fix TOC Top/Bottom scroll using correct container The scroll function was targeting markdownContainerRef (inner content div) instead of contentRef (the actual scrollable parent container). --- src/renderer/components/FilePreview.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/FilePreview.tsx b/src/renderer/components/FilePreview.tsx index 3efa632d..8c22963d 100644 --- a/src/renderer/components/FilePreview.tsx +++ b/src/renderer/components/FilePreview.tsx @@ -655,7 +655,8 @@ export const FilePreview = forwardRef(funct const scrollMarkdownToBoundary = useCallback( (direction: 'top' | 'bottom') => { - const container = markdownContainerRef.current; + // Use contentRef which is the actual scrollable container + const container = contentRef.current; if (!container) return; const top = direction === 'top' ? 0 : container.scrollHeight; container.scrollTo({ top, behavior: 'smooth' });