wordpress-develop icon indicating copy to clipboard operation
wordpress-develop copied to clipboard

Accessibility: Make Customizer back button keyboard focusable

Open himanshupathak95 opened this issue 11 months ago • 6 comments

Trac ticket: https://core.trac.wordpress.org/ticket/63011

This PR fixes the accessibility issue where the Customizer back button was not keyboard-focusable. By removing the tabindex="-1" attribute from the back button in the Customizer section template, keyboard users can now navigate to and activate the back button.

Before -

https://github.com/user-attachments/assets/0c4c595b-a921-4b96-ae51-54eb764dbd02

After -

https://github.com/user-attachments/assets/281353ff-6fe4-42ab-b41a-095d8ae25e9a

himanshupathak95 avatar Feb 24 '25 15:02 himanshupathak95

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance, it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

github-actions[bot] avatar Feb 24 '25 16:02 github-actions[bot]

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props abcd95, ankitmaru, wildworks.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

github-actions[bot] avatar Feb 24 '25 16:02 github-actions[bot]

Here is a screencast of the keyboard navigation for all the sections -

https://github.com/user-attachments/assets/2e8609ae-8ef5-413a-a49c-bfd40ed676bc

himanshupathak95 avatar Feb 24 '25 16:02 himanshupathak95

@himanshupathak95 Thanks for the patch! The fix works well, and making the back button keyboard-focusable improves accessibility. 👍

xwpankit avatar Feb 25 '25 06:02 xwpankit

Thanks for the PR!

I think there are a few additional things that need to be addressed to fully address this issue.

t-hamano avatar Mar 06 '25 02:03 t-hamano

Thanks, @t-hamano, for the suggestions.

I have updated all the places needed for keyboard navigation. After testing, I found that the JS code change is not necessary since the tabindex attributes are being added directly in the PHP templates. Also, the Qunit tests are not affected either, but I am not sure if we have to update them.

himanshupathak95 avatar Mar 24 '25 12:03 himanshupathak95

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 60482 GitHub commit: https://github.com/WordPress/wordpress-develop/commit/74c101b3dffff9fee96eb4da92cd55884d908cda

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

github-actions[bot] avatar Jul 18 '25 03:07 github-actions[bot]