Accessibility: Display a tooltip on toggle tip buttons to expose their accessible name#12532
Accessibility: Display a tooltip on toggle tip buttons to expose their accessible name#12532i-am-chitti wants to merge 2 commits into
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe 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
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Trac ticket
https://core.trac.wordpress.org/ticket/65633
Summary
With no visible text label, a toggle tip's toggle button (from
wp_get_toggletip()) exposes its accessible name only througharia-label. That name reaches assistive technologies but is invisible to sighted mouse and keyboard users, who get no on-hover or on-focus indication of what the button does.A
tooltipalready shows a hover/focus popover surfacing its accessible name. This PR brings the same affordance to toggle tips, which was deferred as a "nice to have" in #51006.Changes
wp-includes/general-template.php— the toggle tip markup now also outputs a hint popover carrying the button's label:js/_enqueues/wp/wp-tooltip.js— shows the hint on mouseenter/focus and hides it on mouseleave/blur, mirroring the tooltip behaviour. The hint is suppressed while the toggle tip dialog is open, so the two never overlap.wp-admin/css/wp-tooltip.css—.wp-tooltip__hintreuses the tooltip bubble styling.tests/phpunit/tests/general/wpGetTooltip.php— added coverage for the hint markup, label duplication, and escaping.Behaviour is unchanged for the tooltip type and for assistive technologies.
Testing instructions
Screenshots
Related