Skip to content

Commit a7b016b

Browse files
authored
fix(files): make the rich-markdown-field container a positioning context (#6435)
rich-markdown-field also mounts EditorBubbleMenu with its own container ref, so the same 'relative' the editor container needs applies here — otherwise the absolutely-positioned toolbar resolves against the wrong offset parent and scroll tracking breaks in the field. Safe in both modes: 'relative' adds no offset and no clipping to the uncapped (page-scrolls) box.
1 parent 33fe043 commit a7b016b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-field.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ function LoadedRichMarkdownField({
182182
<div
183183
ref={containerRef}
184184
className={cn(
185-
'flex flex-col px-3 py-2',
185+
// `relative` makes this the positioning context for the bubble menu, which is
186+
// appended here and absolutely positioned so it tracks the selection through scroll.
187+
'relative flex flex-col px-3 py-2',
186188
// Only a capped box scrolls itself. Uncapped, the box grows and the page
187189
// scrolls — making it a scroll container anyway would clip the bubble
188190
// menu against an edge that never moves.

0 commit comments

Comments
 (0)