Skip to content

Conversation

@redallen
Copy link
Contributor

@redallen redallen commented May 5, 2021

What: Closes #5745

Additional issues:

@patternfly-build
Copy link
Collaborator

patternfly-build commented May 5, 2021

@KKoukiou
Copy link
Collaborator

KKoukiou commented May 5, 2021

@redallen I tried it interactively now, I am not really happy with this change. I feel that if I was a user, hovering over a button, I would not leave my mouse there for more than a second to see that.

In addition, In cockpit I can't think of any scenario where this change makes sense, so we would need to change the properties to the previous state.

So, since the properties are exposed, the reporter of the issue can adjust them for their scenario. And I honestly don't see the severeness of the reported issue, if the user scrolls with the mouse, and tooltips get activated, they can move the mouse slightly to the side.

@redallen
Copy link
Contributor Author

redallen commented May 5, 2021

The way tooltips work in most design systems is that there is some delay. This solves bugs when scrolling through tooltips like this:
image

I'm thinking about adding a check to see if there is a single Button/Icon element and setting it to 0 in that case.

@redallen
Copy link
Contributor Author

redallen commented May 5, 2021

@KKoukiou I've added the check. Are there cases other than buttons or icons where you'd expect no delay?

Copy link
Collaborator

@KKoukiou KKoukiou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will think about thoroughly tomorrow if there is no need for this to be merged today.


function isButtonOrIcon(children: React.ReactNode) {
if (React.isValidElement(children)) {
if (['button', Button as any, 'svg', 'g'].includes(children.type)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkbox, Radio we also use tooltips to 'explain' why elements are disabled.

So when we disable a checkbox, we always wrap it with a tooltip and say 'Please blabla to enable this feature'

Copy link
Contributor

@kmcfaul kmcfaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be considering breaking as the default values are changing?

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@redallen I agree with Katie. I believe this is a breaking change. I would be ok changing the defaults for the beta components only.

@redallen
Copy link
Contributor Author

When would this lead to unexpected behavior @tlabaj or @kmcfaul ? I consider it a bug that PatternFly tooltips show up instantly when in most operating systems and JS frameworks they have some delay. This leads to weird scenarios where pages can show more than one tooltip.

If you can think of cases where you expect a no-delay tooltip I can add them to the isButtonOrIcon check to leave them untouched.

@mcarrano
Copy link
Member

After discussing further with @redallen @tlabaj and @kmcfaul we have decided to set the default delay before showing a tooltip on hover to be 500ms. As was stated above, this is expected behavior for tooltips and is consistent with what is seen for most web applications and operating systems. The initial delay of 1 second (1000ms) was probably too long so at half a second it's enough time to sense that the user has stopped mouse movement over an element while preventing tootips from firing as the user is just moving the mouse over the screen. While I recognize that this is technically breaking I view the current behavior as an oversight vs intended.

@redallen redallen force-pushed the fix/tooltip-default-1s branch from 7e63c37 to 792d3b8 Compare May 25, 2021 18:35
@redallen redallen requested a review from mcarrano May 26, 2021 18:00
Copy link
Member

@mcarrano mcarrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks @redallen !

@redallen redallen merged commit 9f35132 into patternfly:master May 27, 2021
@patternfly-build
Copy link
Collaborator

Your changes have been released in:

  • @patternfly/react-catalog-view-extension@4.11.33
  • @patternfly/react-code-editor@4.2.67
  • @patternfly/react-console@4.8.9
  • @patternfly/react-core@4.123.2
  • @patternfly/react-docs@5.18.42
  • @patternfly/react-inline-edit-extension@4.6.116
  • demo-app-ts@4.100.2
  • @patternfly/react-log-viewer@4.1.10
  • @patternfly/react-table@4.27.15
  • @patternfly/react-topology@4.8.63
  • @patternfly/react-virtualized-extension@4.8.14

Thanks for your contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add built in delay in tooltips

7 participants