-
Notifications
You must be signed in to change notification settings - Fork 800
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
Improve image carousel accessibility #39913
Conversation
Accessibility has been improved by reducing which images receive a tab index and an aria role of button. This has been done by moving it out of PHP, where it applied the two attributes to all images in the post, to setting it in javascript, alongside where the interactivity is being setup. An aria-label has been added for good measure.
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
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.
Thank you for looking at this and for an excellent solution!
The main change I noticed was in images that did not link to anything - with this PR the role of button and tabIndex have been removed, which is now what we want.
I did notice something else - two different issues - but they were also an issue before:
- A Tiled Gallery set to link to 'None' still defines a role of button and tabIndex of 0. Both clicking on it and tabbing to it then pressing enter result in no action being taken, which is what I'd assume would be expected. So it looks like they would also need the role and tabIndex removed.
- An image set to link to an attachment page opens a lightbox if Carousel is enabled if using keyboard and pressing enter, but opens the attachment page if clicking on it (I'd assume it should open the lightbox). If Carousel is not enabled, both clicking on it and tabbing to it then clicking / entering open the attachment page.
These are both quite specific issues, not related to the report anyway, so I'd be happy to create follow-up issues for these.
@coder-karen would rather get this issue landed rather than growing the scope. If you share the links though I will see if I can find some time for those issues too. |
Fixes #39908
Proposed changes:
Accessibility has been improved by reducing which images receive a tab index and an aria role of button.
This has been done by moving it out of PHP - where it applied the two attributes to all images in the post, and into javascript where it can be added when applying the interactivity which makes the attributes necessary.
An aria-label has been added for good measure.
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
GB
role=button
and atabIndex=0
regardless of whether they do act as a buttonrole=button
and atabIndex=0
and additionally, they don't have a warning about not being labelled.TinyMCE