Terra-core: [terra-button] Add feature to show tooltips for icon-only buttons

Created on 26 Mar 2019  路  3Comments  路  Source: cerner/terra-core

Feature Request

Description

Current Icon-only Buttons do not show the label by design, and usage would be greatly improved by adding browser-native title attribute tooltips that reveal the label to a user when hovering on the icon-only button.

terra-button help wanted

All 3 comments

We'll use the text prop to populate this title attribute and only do this on isIconOnly. We'll want to make sure and take a look at the doc site to make sure that the isIconOnly example is more clear about what is happening.

I ran into an issue while trying to test the implementation via WDIO. The tooltip does not seem to be shown in the screenshot upon hovering over the button via automation - all that I am doing is browser.moveToObject('#iconOnlyButton'); - it does hover over the button but the tooltip ain't shown.

I wonder if the implicit delay to show the native tooltip is the root cause but I am not entirely sure.

Working Example:

Screen Shot 2019-04-02 at 12 25 37 PM

Test Screenshot:

Icon_only-Hovered default

I think a jest test should suffice for this one. What are your thoughts on this, @ryanthemanuel @bjankord?

Yeah, talked in scrum, we're good with just having a jest test for this.

Was this page helpful?
0 / 5 - 0 ratings