[wp-trac] [WordPress Trac] #64169: Add JavaScript that allows front-end elements with role="button" to be triggered with the spacebar
WordPress Trac
noreply at wordpress.org
Wed Oct 29 17:51:47 UTC 2025
#64169: Add JavaScript that allows front-end elements with role="button" to be
triggered with the spacebar
---------------------------+-----------------------------
Reporter: alh0319 | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Script Loader | Version:
Severity: normal | Keywords:
Focuses: accessibility |
---------------------------+-----------------------------
Many plugins and themes attempt to remediate accessibility problems by
adding `role="button"` to elements, but fail to add the necessary
JavaScript that allows these elements to be triggered with the spacebar,
as is expected functionality for buttons.
This seems like an opportunity area for WordPress core to globally fix a
specific accessibility problem on many sites with little downside. Here's
how [https://github.com/woocommerce/woocommerce/pull/59578 WooCommerce did
something similar] in their core product to avoid having to load this
JavaScript in every individual add-on plugin.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64169>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list