From 0fce5358b66624775c71861aa3735e1478b214a2 Mon Sep 17 00:00:00 2001 From: Waleed Date: Tue, 4 Aug 2026 23:24:56 -0700 Subject: [PATCH] fix(files): stop markdown reflow on open by matching placeholder wrapping to the editor (#6285) --- .../rich-markdown-editor/rich-markdown-editor.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-editor.tsx b/apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-editor.tsx index ffb118973d..83730f5465 100644 --- a/apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-editor.tsx +++ b/apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-editor.tsx @@ -1198,10 +1198,12 @@ export function LoadedRichMarkdownEditor({ }} /> {showPlaceholder && placeholderHtml && ( - // Instant read-only content while the collaborative doc seeds; the editor stays mounted-but- - // hidden below so it renders the seeded doc before the swap. Same layout box → no reflow. + // Instant read-only content while the collaborative doc seeds, swapped for the live editor + // once ready. The `ProseMirror` class is load-bearing: it gives the placeholder the same base + // text layout as the live editable (prosemirror-view sets `white-space: break-spaces` and + // disables ligatures), so a line wraps identically and never re-wraps on the swap.
)}