Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

ARIA input fields do not have accessible names #1127

Closed

Description

@Rich-Harris

Describe the issue

Since this is my first issue here, let me first congratulate you on CodeMirror 6 — we recently switched https://learn.svelte.dev from Monaco to CodeMirror and it's been an absolute dream.

While running a https://pagespeed.web.dev audit I saw the following accessibility warning relating to the CodeMirror editor:

ARIA input fields do not have accessible names

When an input field doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. Learn more about input field labels.

You can easily reproduce it with the CodeMirror website: https://pagespeed.web.dev/analysis/https-codemirror-net/9g1le9r30c?form_factor=mobile

I'm not certain what the correct fix would be, but perhaps something like an aria-label attribute with a (configurable?) value of 'CodeMirror editor' would address it.

Browser and platform

No response

Reproduction link

https://pagespeed.web.dev/analysis/https-codemirror-net/9g1le9r30c?form_factor=mobile

Activity

  1. marijnh commented on Apr 11, 2023

    @marijnh
    Member

    You can use contentAttributes.of({"aria-label": "some meaningful label"}) to do this. A default label would not really help much (it'd know nothing of the context or language in which the editor is used, and not do much beyond hiding the warning), so the library intentionally doesn't add one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions