react-md-editor icon indicating copy to clipboard operation
react-md-editor copied to clipboard

The <MDEditor /> component is creating accessibility issues in my project

Open matthewpagacik12 opened this issue 9 months ago • 2 comments

When using the <MDEditor /> component in my project, it is creating accessibility issues for on the <textarea /> and <input /> elements. (See image)

Image

Image

Image

Image

Here is the extension I am using to check for accessibility issues

matthewpagacik12 avatar Apr 28 '25 19:04 matthewpagacik12

@matthewpagacik12 have you tried something like:

      <MDEditor
        ...
        components={{
          textarea(props) {
            return <textarea name="description" aria-label={"Description"} {...(props as TextareaHTMLAttributes<HTMLTextAreaElement>)} />;
          },
        }}

-- EDIT: while this fixes the a11y issue, this causes a number of regressions in the behavior of the editor… We probably need all the features in Textarea.tsx

janvorwerk avatar Jul 07 '25 12:07 janvorwerk

Ran into this issue today as well. The "id" that is passed into MDEditor is put on a parent <div> instead of the <textarea>.

Image

It should be noted that the textareaProps prop exists on MDEditor which lets you set these values, but this breaks with things like Ant's Form elements, which automatically pass in form attributes to their children.

mendahu avatar Aug 24 '25 22:08 mendahu