Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
HTML block: CodeMirror accessibility (and JS TypeErrors) #6680
The CodeMirror implementation for the HTML block should match as much as possible what was done in core for other CodeMirror instances, with regards to accessibility.
ARIA roles, properties and labelling:
The CodeMirror contenteditable area needs to be exposed as a role
The contenteditable area needs to be properly labelled.
Since the Tab key is used to insert a tab character, users need to be informed that to exit the CodeMirror area they have to press the Escape key first.
For example, this is what core does for the theme editor, using jQuery. See https://core.trac.wordpress.org/changeset/41586
The same attributes should be used in the Gutenberg implementation. These attributes need to be set on the contenteditable area returned by
After pressing Escape and tabbing away from the HTML block with Tab or Shift+Tab, I get these errors:
@designsimply not sure why there's the need for the
I'd say this should be milestoned for 5.0, as releasing it in its current state won't even have feature parity with the implementation of CodeMirror in core. @mtias any objections?