opensearch-project / oui

OpenSearch UI Framework
Apache License 2.0
35 stars 69 forks source link

Should button `title` tooltips apply to the entire button or just the label/icon? #1207

Open joshuarrrr opened 8 months ago

joshuarrrr commented 8 months ago

Is your feature request related to a problem? Please describe.

In https://github.com/opensearch-project/oui/pull/1160, we fixed an issue where icon-only buttons didn't have a tooltip/title attribute to display text on hover. Now that we've fixed that, I noticed that, because the title attribute is only applied to the button content it only activates when hovering directly over the label text or icon. If you hover the part of the button that's mostly padding, you don't get the tooltip hint. See the demo:

https://github.com/opensearch-project/oui/assets/1679762/c286ab6a-a677-4e4b-97a1-4071e88a1ce6

Describe the solution you'd like

I think the tooltip is especially helpful in cases where users aren't familiar with the icon. But it seems like it would be better to trigger/apply it to the entire button, rather than just the contents. @kgcreative any thoughts or preferences from the UX side?

BigSamu commented 8 months ago

@joshuarrrr @BSFishy you can give me this tot ake a look

joshuarrrr commented 8 months ago

I'd like a little more validation that other folks think this is a good idea/worth doing before we invest in it.

kgcreative commented 8 months ago

for accessibility reasons, it should trigger on hover over the whole button element

BigSamu commented 8 months ago

Agree on that. Thinking that in terms of UX experience this better for a user