WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.52k stars 4.21k forks source link

Make tooltips dismissable #15145

Open afercia opened 5 years ago

afercia commented 5 years ago

Opening this issue to associate it to the pending PR #8147

As noted in #8033, in some edge cases the Gutenberg tooltips can overlay other buttons in the user interface. Also, according to the Web Content Accessibility Guidelines, tooltips need to be dismissable.

WCAG reference: Success Criterion 1.4.13 Content on Hover or Focus https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus https://www.w3.org/WAI/WCAG21/Understanding/content-on-hover-or-focus.html

There are 3 items to address to meet the requirement:

8033 made the tooltips persist but the "dismissable" part is missing. The guideline requires "a mechanism to dismiss the additional content without moving pointer hover or keyboard focus", and the suggestion is "by pressing Escape".

The correct behavior was visible, for example, on the previous Gmail interface (you can still revert Gmail to "Classic Gmail" for testing):

Not sure how to implement such a "global" Escape key behavior for all the tooltips in the UI.

For now, #8147 addresses just a first part by making use of onMouseDown:

Anyone willing to continue work on #8147 is very welcome!

afercia commented 5 years ago

Note: this was also reported in the WPCampus/Tenon accessibility report, see https://github.com/WordPress/gutenberg/issues/15344. Suggest: give higher priority.