mdx-editor / mdx-editor/editor

[BUG] imagePlugin dialog missing aria-describedby / DialogDescription

Open
#792 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
3.7k
Forks
307
Avg merge
14h 22m
Merged PRs (30d)
5

Description

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • I have read the documentation and cannot find an answer.

Describe the bug

Using imagePlugin() from @mdxeditor/editor in a React (Next.js) project results in the following accessibility warning in the dev console when the insert image dialog is triggered:

Warning: Missing Description or aria-describedby={undefined} for {DialogContent}.

This seems to be due to the dialog rendered by imagePlugin missing a <DialogDescription> element or an aria-describedby attribute. This breaks ARIA compliance and triggers warnings in environments using MUI or accessibility-enforcing dev tools.

Reproduction

Start from https://codesandbox.io/p/sandbox/mdx-editor-base-q8s7zr?file=/src/App.tsx

Then apply the following changes:

  1. Add the imagePlugin() to the plugin list.
  2. Render <MDXEditor />.
  3. Trigger the image dialog (via InsertImage toolbar button).
  4. Observe the console warning in dev tools.

To Reproduce
Steps to reproduce the behavior:

  1. Use imagePlugin() in the editor.
  2. Click on the "Insert Image" button in the toolbar.
  3. Observe the browser dev console.
  4. See the warning regarding DialogContent.

Expected behavior

The image dialog should include a proper aria-describedby or a <DialogDescription> element. This would suppress the warning and improve accessibility support (especially for screen readers).

Screenshots

N/A — warning appears in console only:

Warning: Missing Description or aria-describedby={undefined} for {DialogContent}.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome 125.0.6422.113 (Official Build) (64-bit)

Additional context

  • The issue originates inside the internal dialog used by imagePlugin, not the parent wrapper or consumer code.
  • Wrapping the editor or passing aria-describedby to the root doesn't help since the dialog is managed internally.
  • A simple fix would be to include a visually hidden <DialogDescription> or expose the option to pass it.

Happy to help test a fix or submit a PR if needed. Thanks again for the awesome work on MDXEditor 🙌

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing imagePlugin() from the Insert Image toolbar button to its internal DialogContent, using the linked CodeSandbox reproduction to trigger the warning. Confirm the dialog's accessible description behavior and verify that the console warning is gone while the dialog remains usable with screen readers.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.