monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

[Feature Request] Ability to announce editor name to screen reader users

Open huyenltnguyen opened this issue 6 months ago • 2 comments

Context

  • [X] This issue is not a bug report. (please use a different template for reporting a bug)
  • [X] This issue is not a duplicate of an existing issue. (please use the search to find existing issues)

Description

If there are multiple editors on the screen, the default aria-label ("Editor content;Press Alt+F1 for Accessibility Options.") is not sufficient to allow screen reader users to tell the editors apart.

I'm wondering if we could allow aria-label to accept editor name or editor language.

For example:

  • aria-label could grab the language value passed to createModel and render [language] editor content;Press Alt+F1 for Accessibility Options.
  • Or we add an name option to createModel. name would be the name of the editor, which can be anything (index.js, index.html, styles.css, etc.), and aria-label would render [name] editor content;Press Alt+F1 for Accessibility Options.

Monaco Editor Playground Link

No response

Monaco Editor Playground Code

No response

huyenltnguyen avatar Dec 24 '23 08:12 huyenltnguyen

Came here to file this issue and found that Huyen has done the work already :)

Passing a screen readable label is neccessary to pass WCAG Success Criterion 1.3.1, Info and relationships. For example, the Playground page on the documentation has 3 different editors, and right now a screen reader users needs to exit forms mode and browse around the page to try and find what the purpose of each editor is.

nchan0154 avatar Apr 10 '24 06:04 nchan0154

I 100% support this issue. Being able to pass 1.3.1 is a critical bug as it's WCAG level A and numerous laws around the world require WCAG AA compliance, so this feature is needed or we will need to stop using this editor. This editor is one of the best, and it should not be difficult to add some way of adding a message before the "Editor content;Press Alt+F1 for Accessibility Options." text that's there now. I'd be fine with having something like: "Main code Editor content;Press Alt+F1 for Accessibility Options." where "main Code" is what I add through an attribute.

frastlin avatar Apr 10 '24 14:04 frastlin