diff --git a/.changeset/fix-mermaid-fullscreen-a11y.md b/.changeset/fix-mermaid-fullscreen-a11y.md new file mode 100644 index 00000000..ec291734 --- /dev/null +++ b/.changeset/fix-mermaid-fullscreen-a11y.md @@ -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. diff --git a/packages/streamdown/lib/mermaid/fullscreen-button.tsx b/packages/streamdown/lib/mermaid/fullscreen-button.tsx index 316095da..94f82e44 100644 --- a/packages/streamdown/lib/mermaid/fullscreen-button.tsx +++ b/packages/streamdown/lib/mermaid/fullscreen-button.tsx @@ -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"
{ if (e.key === "Escape") { handleToggle(); } }} - role="button" - tabIndex={0} + role="dialog" >