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

[Discuss] If aria-labels are supplied, add them to the title attribute as well? #2021

Closed
cchaos opened this issue Jun 10, 2019 · 9 comments
Closed

Comments

@cchaos
Copy link
Contributor

cchaos commented Jun 10, 2019

There's a lot of duplication on the consumer side to supply both a title and aria-label especially on EuiButtonIcon.

Screen Shot 2019-06-10 at 17 18 19 PM

Is there any way we can help out the consumer but auto-providing one or the other?

@PhilippBaranovskiy
Copy link
Contributor

From my perspective, the best way would be to fill the title with the aria-label's value if the title is not provided. At the same time let it overrides with the separately provided value.

@snide
Copy link
Contributor

snide commented Sep 12, 2019

Inclined to close this. Titles and aria-labels are very different things. They sometimes are the same, and may even often be the same, but not always.

@cchaos
Copy link
Contributor Author

cchaos commented Sep 12, 2019

Agreed that they're not always the same, which is why we'd allow the title to be overridden. But more often than not, only aria-label is supplied or both are supplied and they are the same.

I'm mostly thinking about icons and icon buttons that never have textual context and could really use titles to give sighted users insight into the icon's meaning or button's action.

@cchaos cchaos self-assigned this Sep 12, 2019
@cchaos
Copy link
Contributor Author

cchaos commented Oct 21, 2019

This one has stagnated because our current implementation of icons which use SVG do not support the title attribute directly on an <svg> element.

@cchaos cchaos removed their assignment Oct 21, 2019
@myasonik
Copy link
Contributor

Should we even be using title? If we use EuiTooltip instead, we get the accessibility and design "for free", don't we? And then we could reduce the duplication of separate title and aria-label props into one tooltip prop...

@cchaos
Copy link
Contributor Author

cchaos commented Oct 22, 2019

I find our tooltips to be too intrusive to use the as often as we add title. It would then also require us to be wrapping all these elements with EuiToolTip directly which may not be what the consumer expects especially if they want to provide their own tooltip content.

@myasonik
Copy link
Contributor

My biggest concern with supporting the title attribute isn't the duplication or setting them as defaults to one another (which I do think would be a nicer API) but the cases when they are different. In those cases, the title content is almost certainly not accessible.

In which case, I'm back to thinking that custom tooltips are the way to solve this (even if it means a new "subtle" flavor of EuiToolTip.

Sorry if this concern is out of scope of what you originally wanted to discuss - don't mean to hijack your thread.

@cchaos
Copy link
Contributor Author

cchaos commented Sep 18, 2020

See #4040 as related

@cchaos
Copy link
Contributor Author

cchaos commented Sep 18, 2020

Closing in favor of a Meta discussion around EuiTooltip flexibility which I've included a link to this discussion but needs to be a part of a greater effort.

@cchaos cchaos closed this as completed Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants