Skip to content

Commit 5d7b4d9

Browse files
committed
fix(files): render single pass when interactive to avoid index drift
1 parent 5f7c61f commit 5d7b4d9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/preview-panel.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,16 @@ const MarkdownPreview = memo(function MarkdownPreview({
247247

248248
checkboxCounterRef.current = 0
249249

250+
if (onCheckboxToggle) {
251+
return (
252+
<div ref={scrollRef} className='h-full overflow-auto p-6'>
253+
<ReactMarkdown remarkPlugins={REMARK_PLUGINS} components={components}>
254+
{content}
255+
</ReactMarkdown>
256+
</div>
257+
)
258+
}
259+
250260
const committedMarkdown = useMemo(
251261
() =>
252262
committed ? (

0 commit comments

Comments
 (0)