mirror of
https://github.com/jlengrand/Maestro.git
synced 2026-03-10 08:31:19 +00:00
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).
This commit is contained in:
@@ -655,7 +655,8 @@ export const FilePreview = forwardRef<FilePreviewHandle, FilePreviewProps>(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' });
|
||||
|
||||
Reference in New Issue
Block a user