Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion packages/ui/src/Collapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,19 @@ export const Collapse = ({
...style,
}}
>
<div ref={contentRef}>{children}</div>
<div
ref={contentRef}
// flow-root: the measured element must be a block formatting
// context, or children's margins collapse through it and
// scrollHeight under-measures — the outer (overflow: hidden)
// wrapper IS a BFC and needs the full height, so the mismatch
// clips the last line of margined content (python-editor's API
// docs). Rendering is unchanged: the margins always displayed
// inside the outer BFC.
className={css({ display: "flow-root" })}
>
{children}
</div>
</div>
);
};