Skip to content
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

fix: tooltips remain visible when hovered #5701

Merged
merged 4 commits into from
Mar 4, 2022
Merged

Conversation

scomea
Copy link
Collaborator

@scomea scomea commented Mar 3, 2022

📖 Description

According to standards, the tooltip content should remain visible if the pointer is hovered over it:

Hoverable
If pointer hover can trigger the additional content, then the pointer can be moved over the additional content without the additional content disappearing;

Source: https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus

This change adds a short 60ms delay before tooltips are dismissed after mouseOut. Tooltips remain visible if the anchor or tooltip are hovered before the delay elapses.

🎫 Issues

closes #5660

✅ Checklist

General

  • I have included a change request file using $ yarn change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Component-specific

return;
}

if (this.hideDelayTimer !== null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit pick: this.hideDelayTimer !== null check isn't needed. It happens in this.clearHideDelayTimer().

Also, it might be better to have this before the check if tooltip isn't visible on line 377 to make sure that it's always cleared.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@scomea scomea force-pushed the users/scomea/tooltip-hover branch from ba27252 to 4a57056 Compare March 4, 2022 21:10
@scomea scomea merged commit b9eb24e into master Mar 4, 2022
@scomea scomea deleted the users/scomea/tooltip-hover branch March 4, 2022 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: tooltip does not conform to a11y standards
4 participants