Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tooltip] Tooltips should not disappear when hovered #11705

Closed
2 tasks done
franklixuefei opened this issue Jun 4, 2018 · 3 comments
Closed
2 tasks done

[Tooltip] Tooltips should not disappear when hovered #11705

franklixuefei opened this issue Jun 4, 2018 · 3 comments
Assignees
Labels
component: tooltip This is the name of the generic UI component, not the React module!

Comments

@franklixuefei
Copy link
Contributor

  • This is a v1.x issue (v0.x is no longer maintained).
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

When hovering on the tooltips, they should not disappear.

Current Behavior

Tooltip still disappear when hovered.

Context

I need the tooltips to stay visible when they are hovered so that the users can copy the data in the tooltip.
I understand that this may be a problem for Popper.js. Any suggestions on how to enable this feature would be appreciated!

Your Environment

Tech Version
Material-UI v1.1.0
React 16.4.0
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: tooltip This is the name of the generic UI component, not the React module! labels Jun 4, 2018
@mbrookes
Copy link
Member

mbrookes commented Jun 4, 2018

The Tooltip doesn't disappear when hovered, it disappears when its child is no longer hovered. If you wanted to change that behaviour you could use a controlled Tooltop: https://codesandbox.io/s/81m1qp4p09

@franklixuefei
Copy link
Contributor Author

franklixuefei commented Jun 5, 2018

@mbrookes Thanks for your suggestion! I understand that this problem can be resolved by using controlled props, but in most cases, it makes sense that users would expect the tooltip to stay there when they are hovered, so I think this behavior should be supported natively by @material-ui.

BTW, in your example, you forgot to implement handleClose :-P

@mbrookes
Copy link
Member

mbrookes commented Jun 5, 2018

Tooltip to stay there when they are hovered

Ah, I misunderstood your issue title "Tooltips should not disappear when hovered" as suggesting a cause and effect.

Staying when hovered is the opposite. :-D

you forgot to implement handleClose

No, I left it as an exercise for the reader.:-) (or rathe,r I simply took the docs demo and removed the body of that function...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tooltip This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

3 participants