-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Post Settings toggle controls not keyboard focusable or triggerable #1824
Comments
It seems to me they're focusable and can be activated with a keyboard, but they miss a focus style. See #1562 |
Got you. Activated with space bar. Agree re: focus style. |
Hm now that you made me think better at this, I see the potential issue. I knew these toggles are implemented with styled checkboxes so it was natural to me to use the spacebar. However, there's no reason why keyboard users should have a clue they're checkboxes. Only screen reader users will get them right because their screen reader will announce "checkbox". |
@afercia Any thoughts around implementing the toggles as |
@svinkle interesting. Yep, |
@afercia @abrightclearweb It looks like the styles are based on the parent A dirty temp hack would be to listen for focus w/JS and apply a class to the parent |
The purpose of introducing a "new" toggle element (as opposed to just using a checkbox), is to imply that once you toggle the switch, the action is already saved. A checkbox usually requires an explicit "Save" button later on in the page, or the check won't be saved. I think the toggle is great for this. But we know we want it to be accessible. I would be reluctant to use JS hacks to make it accessible, especially if they aren't super simple. I'd rather look at alternate designs, including alternate markup. Remember, if we get the switch component right once, we get it right forever. I know @afercia has mentioned that it's possible to make switch designs accessible, so I'm curious what we are doing wrong, CSS-wise, and how we might be able to do it differently. |
@jasmussen well it's not just an accessibility issue, it's also usability. However, sighted keyboard users see something that doesn't look like a checkbox. Once the control is focused, they will likely try to activate it pressing Enter, and that won't do anything. |
P.S. as mentioned in other issues, to be fully accessible these switch toggles must always have a visible hint text on/off. |
I'd try this:
Will try a PR. |
I have no problem making the visual label required instead of optional as it is now. Worst case we can switch the label place to be before or after the switch depending on the switch alignment (so the text length difference between on/off doesn't make it jump). And in cases of translations of on/off growing long, if testing suggests it necessary, perhaps we can make the font size smaller? |
OK I have a working solution but it uses DOM methods... 😬 |
Tested on: Gutenberg 0.3, 0.4.
Setup: Mac OS X Sierra, MAMP, Safari 10.1.1.
Gutenberg is the only plugin active.
When tabbing through the Post Settings the Tab key can be used to open the panels and go through the controls one by one.
However, tabbing through does not focus on toggle controls such as the Pending review or Stick to front page toggles within the Status and Visibility section.
Therefore these controls can't be activated by keyboard alone.
The text was updated successfully, but these errors were encountered: