microsoft / microsoft/vscode

Markdown editor: Expose a stable accessible textbox identity

Open
#328,932 0 comments 0 reactions 1 assignee Claimed by @ulugbekna View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## Description

The experimental Markdown editor does not expose a stable editor identity to accessibility APIs. Its actual editing host appears as a generic, unnamed focusable element in both editing and locked modes, so screen reader users cannot identify the control, its multiline nature, or whether it is read-only.

## Reproduction Steps

1. Open a document in the Markdown editor.
2. Inspect the editor with a screen reader or browser accessibility inspector, or navigate to it using Tab.
3. Observe the focused editing host in Editing mode.
4. Switch the editor to Locked mode and inspect the same host again.

## Expected Behavior

The editing host exposes:

- `role="textbox"`
- A configurable accessible name, defaulting to `Markdown editor`
- `aria-multiline="true"`
- `aria-readonly` synchronized with the model state

The accessible identity should remain stable when switching between editing and locked modes.

## Actual Behavior

The accessibility tree exposes a generic, unnamed focusable element in both editing and locked modes. It does not communicate textbox identity, an accessible name, multiline behavior, or synchronized read-only state.

## Confirmed Root Cause

- The actual editing host is a focusable `div` with `tabindex="0"`, created in `packages/core/src/view/editorView.ts` around lines 212-217.
- An EditContext is attached to that element around lines 326-331.
- There is no hidden native editor that supplies semantics.
- The host does not provide the required ARIA role, name, multiline, or read-only attributes, so accessibility APIs expose the underlying generic focusable element.

## Additional Context / Fix Direction

Add stable textbox semantics directly to the EditContext host: `role="textbox"`, a configurable accessible name with `Markdown editor` as the default, `aria-multiline="true"`, and observable synchronization of `aria-readonly` with the model. Preserve the same accessible identity across editing and locked modes.

Nested editor chrome should eventually be moved outside the textbox subtree so controls are not exposed as descendants of the text-editing control.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.