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
11 changes: 11 additions & 0 deletions .changeset/gold-feet-strive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"streamdown": patch
---

Fix mermaid fullscreen overlay accessibility and add stable selector

- Add `data-streamdown="mermaid-fullscreen"` to fullscreen overlay for stable CSS targeting
- Update fullscreen overlay semantics to match table fullscreen behavior
- Change `role` from `button` to `dialog`
- Add `aria-modal="true"` for correct screen reader modal behavior
- Improve accessibility consistency between mermaid and table fullscreen overlays
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: "div is used as a backdrop overlay, not a button"
<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