Skip to content

Commit afbcf11

Browse files
committed
fix(mermaid): use absolute positioning for action buttons to fix clicks in nested scroll containers
Same fix as code-block (ab0a5ae): switches the mermaid block action button wrapper from position:sticky to position:absolute so that hit-testing works correctly in layouts with multiple nested overflow:auto scroll containers. The mermaid block container already has position:relative, so only the inner toolbar wrapper needed updating. Fixes vercel#494
1 parent ab0a5ae commit afbcf11

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/streamdown/lib/components.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ const CodeComponent = ({
894894
{shouldShowMermaidControls ? (
895895
<div
896896
className={cn(
897-
"pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"
897+
"pointer-events-none absolute top-2 right-2 z-10 flex items-center"
898898
)}
899899
>
900900
<div

0 commit comments

Comments
 (0)