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] disableHoverListener shows title #13346

Closed
DostoevskyMF opened this issue Oct 22, 2018 · 3 comments
Closed

[Tooltip] disableHoverListener shows title #13346

DostoevskyMF opened this issue Oct 22, 2018 · 3 comments
Labels
bug 🐛 Something doesn't work component: tooltip This is the name of the generic UI component, not the React module!

Comments

@DostoevskyMF
Copy link

The uncontrolled tooltip with disableHoverListener set on true.

Expected Behavior

The setup disableHoverListener property affects the visibility of the standard html title property

Current Behavior

When the disableHoverListener prop is true and open prop is't present then standart html title is appear on wrapped elemen by on hover event.

Examples

  <Tooltip 
      disableHoverListener
      title="text" 
      <TextField />
  </Tooltip>
@oliviertassinari oliviertassinari added the component: tooltip This is the name of the generic UI component, not the React module! label Oct 22, 2018
@eps1lon
Copy link
Member

eps1lon commented Oct 26, 2018

Isn't that what it's supposed to do? Don't prevent the default behavior and fallback to native tooltip behavior?

What is to use case for this? Why would you use the Tooltip component if you never want to display a tooltip?

I guess you issue is that you're passing undefined to open while you consider that Tooltip controlled? Have you considered casting to a boolean e.g.

 <Tooltip 
      open={Boolean(possiblyUndefinedControlledOpen)}
      title="text" 
      <TextField />
  </Tooltip>

@oliviertassinari oliviertassinari changed the title Uncontrolled tooltip [Tooltip] disableHoverListener shows title Oct 27, 2018
@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Oct 27, 2018
@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 27, 2018

@eps1lon I believe it's a bug. We shouldn't be displaying the native title even when people are using disableHoverListener: https://codesandbox.io/s/ooqx0oz555.

capture d ecran 2018-10-27 a 17 47 19
We need to change the handler a bit. It shouldn't be too hard to fix, but it's not very important either.

@DostoevskyMF
Copy link
Author

DostoevskyMF commented Oct 28, 2018

@eps1lon I mean a behavior that @oliviertassinari showed. In the docs in trigger sections same case https://material-ui.com/demos/tooltips/
In this case we can't to disable showing standard tooltip and the prop disableHoverListener becomes useless

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work 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