Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions .changeset/fix-mermaid-fullscreen-a11y.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"streamdown": patch
---

fix(mermaid): add data-streamdown, aria-modal, and correct role to fullscreen overlay

The Mermaid fullscreen overlay was missing the `data-streamdown="mermaid-fullscreen"` attribute and using `role="button"` instead of `role="dialog"`, and was missing `aria-modal="true"`. This matches the table fullscreen overlay pattern and enables stable CSS targeting and correct accessibility semantics.
8 changes: 5 additions & 3 deletions packages/streamdown/lib/mermaid/fullscreen-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,21 @@ export const MermaidFullscreenButton = ({

{isFullscreen
? createPortal(
// biome-ignore lint/a11y/useSemanticElements: "div is used as a backdrop overlay, not a button"
// biome-ignore lint/a11y/noNoninteractiveElementInteractions: "dialog overlay needs click-to-dismiss"
<div
aria-label={t.viewFullscreen}
aria-modal="true"
className={cn(
"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"
)}
data-streamdown="mermaid-fullscreen"
onClick={handleToggle}
onKeyDown={(e) => {
if (e.key === "Escape") {
handleToggle();
}
}}
role="button"
tabIndex={0}
role="dialog"
>
<button
className={cn(
Expand Down
Loading