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

Add title attribute to IconButton for enhanced accessibility #292

Merged
merged 2 commits into from
Jul 2, 2024
Merged

Add title attribute to IconButton for enhanced accessibility #292

merged 2 commits into from
Jul 2, 2024

Conversation

msobiecki
Copy link
Contributor

@msobiecki msobiecki commented Jul 2, 2024


By adding a title attribute, we ensure that sighted users receive a tooltip on hover, enhancing the overall usability of the button. This change complements the existing aria-label attribute, making the button more accessible and informative to all users.

  • Updated IconButtonProps to omit "title" in addition to "type" and "aria-label".
  • Added title={translateLabel(labels, label)} to the button element in the IconButton component.

This change improves the accessibility and usability of our IconButton component by ensuring that all users, including those using screen readers and those who rely on tooltips, can easily understand the button's purpose.

By adding a title attribute, we ensure that sighted users receive a tooltip on hover, enhancing the overall usability of the button. This change complements the existing aria-label attribute, making the button more accessible and informative to all users.

- Updated IconButtonProps to omit "title" in addition to "type" and "aria-label".
- Added title={translateLabel(labels, label)} to the button element in the IconButton component.
@igordanchenko igordanchenko added the enhancement New feature or request label Jul 2, 2024
@igordanchenko
Copy link
Owner

Thank you for your contribution. Personally, I'm not a big fan of the title attribute tooltips due to their limited utility for keyboard and touchscreen users. However, it's probably a good idea to add them anyway since there is currently no alternative solution for pointer users, and considering that I also have no immediate plans to add full-blown keyboard- and touchscreen-friendly tooltips.

Notes to self on this topic:

Relying on the title attribute is currently discouraged as many user agents do not expose the attribute in an accessible manner as required by this specification (e.g., requiring a pointing device such as a mouse to cause a tooltip to appear, which excludes keyboard-only users and touch-only users, such as anyone with a modern phone or tablet).

https://html.spec.whatwg.org/multipage/dom.html#attr-title

User groups not well served by use of the title attribute

  • Mobile phone users.
  • Keyboard only users.
  • Screen magnifier users.
  • Screen reader users.
  • Users with fine motor skill impairments.
  • Users with cognitive impairments

https://www.tpgi.com/using-the-html-title-attribute-updated/

@igordanchenko igordanchenko merged commit 46c779a into igordanchenko:main Jul 2, 2024
8 checks passed
Copy link

github-actions bot commented Jul 2, 2024

🎉 This issue has been resolved in version 3.21.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Implemented and released label Jul 2, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request released Implemented and released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants