Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[P-181] Keyboard Control for Accessibility #1939

Closed
thiessenp-cds opened this issue Oct 18, 2022 · 3 comments
Closed

[P-181] Keyboard Control for Accessibility #1939

thiessenp-cds opened this issue Oct 18, 2022 · 3 comments

Comments

@thiessenp-cds
Copy link

thiessenp-cds commented Oct 18, 2022

It is currently not possible to operate the form controls using a keyboard (only a mouse). By making the controls operable by a keyboard, a first step towards accessibility conformance would be taken (e.g. WCAG 2.1 + ARIA + ATAG). This would allow the editor to be used in large organizations that have accessibility requirements and help a lot of people out which would be awesome!

Steps

  1. Go to 'anywhere in editor'
  2. Try to navigate to any control by keyboard e.g. using the TAB key
  3. Activate any control using ENTER/SPACE
  4. The control is not reachable by keyboard

Sandbox

https://codesandbox.io/s/github/udecode/plate-playground

Expectation

All form controls can be operated by keyboard. (a future ticket could be about semantics like labels etc.)

Some background

Environment

  • slate: any
  • slate-react: any
  • browser: chrome (/any)

P-181

@thiessenp-cds thiessenp-cds added the bug Something isn't working label Oct 18, 2022
@zbeyens zbeyens added aria and removed bug Something isn't working labels Oct 18, 2022
@AleksandrHovhannisyan
Copy link

(Disclaimer: I'm not a Plate contributor, but I am a Slate user.)

Just noting this for context. whatever solution this involves will probably run into the limitation noted here, unless Plate addressed that issue internally: ianstormtaylor/slate#3412, where the editor selection becomes null whenever the editor loses focus. There are ways to fix that issue for when you click buttons outside the editor, but tabbing out of the editor while preserving a highlight is more problematic. You'd probably need to implement some sort of selection-saving mechanism or a "fake selection" like the one described here: ianstormtaylor/slate#3412 (comment) (Notion does this, for example).

Also, on my end, the CodeSandbox demo doesn't let me tab anywhere because tab is used for indentation. Is this the issue you were referring to?

@zbeyens
Copy link
Member

zbeyens commented Oct 18, 2022

Fake selection is probably the way to go, it would be a workaround to many other issues (e.g. having the focus in an "edit url" popup is hiding the editor selection highlight).

ianstormtaylor/slate#3412 (comment) is a nice attempt, though I'd go with cursor overlay or decorations as it should not be part of the document structure.

@zbeyens zbeyens added the linear Sync GitHub Issue from community members... label Jan 25, 2023
@zbeyens zbeyens changed the title Keyboard Control for Accessibility [P-181] Keyboard Control for Accessibility Jan 25, 2023
@zbeyens zbeyens closed this as not planned Won't fix, can't repro, duplicate, stale Mar 31, 2023
@zbeyens zbeyens reopened this Mar 31, 2023
@zbeyens zbeyens removed the linear Sync GitHub Issue from community members... label Mar 31, 2023
@zbeyens
Copy link
Member

zbeyens commented Jul 7, 2023

We know have an accessible toolbar https://platejs.org/

@zbeyens zbeyens closed this as completed Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants