eui icon indicating copy to clipboard operation
eui copied to clipboard

[EuiButtonGroup] add tooltip support

Open drewdaemon opened this issue 2 years ago • 9 comments

Could we allow tooltips to be attached to buttons in a button group?

drewdaemon avatar Oct 17 '22 15:10 drewdaemon

Hi @andrewctate,

Each button in a EuiButtonGroup supports an HTML title attibute as we can see on the following example. https://codesandbox.io/s/happy-wilson-uik4bz?file=/demo.js.

Screenshot 2022-10-17 at 18 09 43

I wonder if the title attribute is enough or if there is any particular reason you still need a tooltip.

miukimiu avatar Oct 17 '22 17:10 miukimiu

I wonder if the title attribute is enough or if there is any particular reason you still need a tooltip.

Great question, @miukimiu. From my perspective, I believe using an EuiToolTip would be preferable from a consistency and discoverability standpoint. In Lens, most disabled buttons (excluding those in EuiButtonGroup) and inputs utilize EuiToolTip to explain why that element is disabled and how it can be re-enabled. EuiToolTip also allows us to choose between long and short hover delays. Using native browser tooltips via the title attribute on some elements in Lens would introduce a level of inconsistency into the experience. It also doesn't allow us any control over the delay of the tooltip appearing (in which case, they always show after a fairly lengthy delay).

Another great comment came in a previous Slack conversation between @andrewctate and @1Copenut. In it, @1Copenut mentioned the following:

I'd prefer not to add tooltips to disabled buttons. We use the HTML disabled attribute, so the button won't take keyboard focus. This prevents users who navigate by keyboard and use screen readers from accessing the tooltip information.

This is an excellent point, and one that actually extends beyond this request for tooltips on EuiButtonGroup buttons (as this applies to any disabled EuiButtons using a tooltip). When a button element uses the disabled attribute, the tooltips can't be triggered via keyboard focus, as focus is prevented in a disabled state (though hover is still supported, hence why hovering with the mouse still triggers the tooltip). In reading up on the issue, I found a CSS Tricks article that attempts to remedy this issue by switching out the disabled attribute for aria-disabled.

Any thoughts on such an approach (in addition to the core question of whether we are able and willing to add tooltip support for EuiButtonGroup buttons)?

MichaelMarcialis avatar Oct 17 '22 18:10 MichaelMarcialis

Thanks, @MichaelMarcialis for providing more context.

From my perspective, I believe using an EuiToolTip would be preferable from a consistency and discoverability standpoint.

It makes sense. We'll see how we can prioritize this.

We also have plans to introduce aria-disabled instead of a disabled attribute: https://github.com/elastic/eui/issues/5666.

miukimiu avatar Oct 18 '22 11:10 miukimiu

👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

github-actions[bot] avatar Apr 16 '23 16:04 github-actions[bot]

Still valid.

MichaelMarcialis avatar Apr 17 '23 14:04 MichaelMarcialis

👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.

github-actions[bot] avatar Oct 15 '23 00:10 github-actions[bot]

I believe there is still a valid use case for supporting tooltips on individual buttons within a button group.

MichaelMarcialis avatar Oct 18 '23 14:10 MichaelMarcialis

Hey team, just adding my +1 here on liking to see this prioritized if possible. We recently did a big design refresh in Discover that uses EuiButtonGroup for a number of new controls, and the inconsistency between the tooltips on these buttons and all other buttons in our app takes away from the experience a bit. I wouldn't say it's necessarily a "high" priority on our end, but it would be great to see this in the near future if possible to help add some polish to our design refresh: image

davismcphee avatar Jan 12 '24 15:01 davismcphee

👋 Thank you for your suggestion or request! While the EUI team agrees that it's valid, it's unlikely that we will prioritize this issue on our roadmap. We'll leave the issue open if you or anyone else in the community wants to implement it by contributing to EUI. If not, this issue will auto close in one year.

github-actions[bot] avatar Jan 16 '24 17:01 github-actions[bot]