-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add aria-pressed to the editor toolbar toggle buttons. #630
Add aria-pressed to the editor toolbar toggle buttons. #630
Conversation
editor/components/toolbar/index.js
Outdated
@@ -28,7 +28,9 @@ function Toolbar( { controls } ) { | |||
} } | |||
className={ classNames( 'editor-toolbar__control', { | |||
'is-active': control.isActive | |||
} ) } /> | |||
} ) } | |||
aria-pressed={ control.isActive ? 'true' : 'false' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should just be { control.isActive }
.
Now that I look back at that, I think the original intent was to have |
React should handle this for us. It's worth checking what it's actually doing in the dom though. Is the absence of an |
No because the presence of the attribute (even when false) make screen readers announce the button as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking, @aduth, I made those last few comments while mobile. It would be good to circle back to this later and add tests to make sure we're rendering the attribute appropriately (see #641 (comment)). For now, +1 for merging. |
I see approval here, so I'm merging. |
Fixes #628