Skip to content

Accessibility: Make text alignment items radio menu items. - #19233

Merged
gziolo merged 6 commits into
WordPress:masterfrom
MarcoZehe:fix/18721
Dec 19, 2019
Merged

gziolo merged 6 commits into
WordPress:masterfrom
MarcoZehe:fix/18721

Conversation

@MarcoZehe

Copy link
Copy Markdown
Contributor

Description

Pass a role from the alignment toolbar to the dropdown menu. Make the dropdown menu aware of this role on each control and set it if present. Also set aria-checked on the active control if the role calls for it. Fixes #18721.

How has this been tested?

Screenshots

Types of changes

Bug fix.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .

Pass a role from the alignment toolbar to the dropdown menu. Make the dropdown menu aware of this role on each control and set it if present. Also set aria-checked on the active control if the role calls for it. Fixes #18721.
@gziolo gziolo added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended labels Dec 19, 2019

@gziolo gziolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It all makes sense. I guess I missed it completely when converting the alignment options to the dropdown. I think we have the same logic covered already in the MenuItem component, so it would be a good idea to use this component rather than the IconButton. The challenge here is that those block alignment toolbar (groups) support isCollapsed flag. When they aren't collapsed, they should be regular IconButton without the role applied. The easiest way to move forward would be to apply menuitemradio role conditionally and move forward with your proposal. What do you think?

@MarcoZehe

Copy link
Copy Markdown
Contributor Author

It all makes sense. I guess I missed it completely when converting the alignment options to the dropdown. I think we have the same logic covered already in the MenuItem component, so it would be a good idea to use this component rather than the IconButton. The challenge here is that those block alignment toolbar (groups) support isCollapsed flag. When they aren't collapsed, they should be regular IconButton without the role applied. The easiest way to move forward would be to apply menuitemradio role conditionally and move forward with your proposal. What do you think?

Yes, that makes sense. I will add that bit, hoping it will pass. :-) However, I have a problem currently that the conditional role is not yet being applied to those icon buttons. So when I try this PR on gutenberg.run, it is still a normal menu item, and aria-checked is not set at all. So I am not sure why.

@gziolo
gziolo merged commit 1de41d9 into WordPress:master Dec 19, 2019
@gziolo

gziolo commented Dec 19, 2019

Copy link
Copy Markdown
Member

Awesome work, congrats on your first code contribution to Gutenberg 🎉

@MarcoZehe
MarcoZehe deleted the fix/18721 branch December 19, 2019 16:33
@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
@MarcoZehe MarcoZehe mentioned this pull request Jan 17, 2020
8 of 9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Text alignment controls lack semantic indication of the active state

4 participants