material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

Tooltips stick if button opens new modal

Open sahilanguralla opened this issue 9 years ago • 6 comments

Been having a small issue where an IconButton's tooltip will stick and not go away if the button opened a dialog. It won't go away even after closing dialog. You have to hover over button once to make it go.

Expected Behavior

Tooltip should go away if overlay dialog is opened. In general, the tooltip should go away if the mouse does not hover over the button.

Browser Environment

Tech Version
Material-UI 0.17.4
React 15.6.2
browser Google Chrome 62 (Mac OS High Sierra)

sahilanguralla avatar Nov 30 '17 11:11 sahilanguralla

Same behavior for me on v1.0.0-beta.35

rogerjak avatar Mar 05 '18 13:03 rogerjak

Same here.

bielcapanema avatar Mar 13 '18 13:03 bielcapanema

Do you have a reproduction example?

oliviertassinari avatar Mar 13 '18 13:03 oliviertassinari

Kind of happening to me too on v1.0.0-beta.37

  1. Hover over button: tooltip appears.
  2. Click button: tooltip disappears, modal opens.
  3. Close modal: tooltip re-appears even though I'm not hovering the button.

Reproduction example: https://codesandbox.io/s/54j1v7okrl

olavim avatar Mar 15 '18 08:03 olavim

I'm having a similar issue and can even reproduce it on http://www.material-ui.com/ in the IconButton tooltip section:

  1. Hover over button: tooltip appears.
  2. Click button: tooltip disappears.
  3. Minimize screen and then restore screen: tooltip re-appears even though I'm not hovering the button.

Also reproducible this way:

  1. Hover over button: tooltip appears.
  2. Click button: tooltip disappears.
  3. Change tabs and then return to original tab: tooltip re-appears even though I'm not hovering the button.

tried it on Safari, Firefox and Chrome and it only happens on Chrome. I'm currently using Chrome v65.0.3325.181

I know this doesn't happen with a modal, but it seems this issue isn't specifically dependent on the button opening a modal.

abglassford avatar Mar 26 '18 15:03 abglassford

@tilastokeskus Thank you for the reproduction example: https://codesandbox.io/s/4w1m5y7nk4. There are two workarounds:

  1. Make the tooltip not listening to the focus event: disableFocusListener .
  2. Disable the restore focus accessibility feature for the modal: disableRestoreFocus.

oliviertassinari avatar Apr 01 '18 08:04 oliviertassinari