You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Discuss] If aria-labels are supplied, add them to the title attribute as well? #2021
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.
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.
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...
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.
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.
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.
Activity
PhilippBaranovskiy commentedon Jun 17, 2019
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 commentedon 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 commentedon 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 commentedon Oct 21, 2019
This one has stagnated because our current implementation of icons which use SVG do not support the
titleattribute directly on an<svg>element.myasonik commentedon Oct 22, 2019
Should we even be using
title? If we useEuiTooltipinstead, we get the accessibility and design "for free", don't we? And then we could reduce the duplication of separatetitleandaria-labelprops into onetooltipprop...cchaos commentedon 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 commentedon Oct 23, 2019
My biggest concern with supporting the
titleattribute 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, thetitlecontent 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 commentedon Sep 18, 2020
See #4040 as related
cchaos commentedon 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.