Tooltips stick if button opens new modal
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) |
Same behavior for me on v1.0.0-beta.35
Same here.
Do you have a reproduction example?
Kind of happening to me too on v1.0.0-beta.37
- Hover over button: tooltip appears.
- Click button: tooltip disappears, modal opens.
- Close modal: tooltip re-appears even though I'm not hovering the button.
Reproduction example: https://codesandbox.io/s/54j1v7okrl
I'm having a similar issue and can even reproduce it on http://www.material-ui.com/ in the IconButton tooltip section:
- Hover over button: tooltip appears.
- Click button: tooltip disappears.
- Minimize screen and then restore screen: tooltip re-appears even though I'm not hovering the button.
Also reproducible this way:
- Hover over button: tooltip appears.
- Click button: tooltip disappears.
- 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.
@tilastokeskus Thank you for the reproduction example: https://codesandbox.io/s/4w1m5y7nk4. There are two workarounds:
- Make the tooltip not listening to the focus event:
disableFocusListener. - Disable the restore focus accessibility feature for the modal:
disableRestoreFocus.