Allow tooltips to function on disabled elements
See original GitHub issueCurrently, when a tooltip is attached to an element which is in a disabled state, warnings are outputted in the console and the tooltip fails to operate. This is extremely annoying.
This bug is in reference to: https://github.com/mui-org/material-ui/issues/8416
- 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 a tooltip is assigned to a disabled item, the tooltip works like normal. No console warnings or errors are produced.
Current Behavior
When a tooltip is assigned to a disabled item, it produces annoying console spam. Additionally, the tooltip does not display.
To work around this currently, every element that may become disabled is being wrapped in an empty <span>
. This is less that optimal as it clutters the DOM with elements that are completely unneeded.
Steps to Reproduce (for bugs)
https://codesandbox.io/s/rjjn7lx4rq
Context
Tooltips provide context. When a button is disabled, I need to convey to my user why that button is disabled. I currently cannot use tooltips to do this because of this limitation.
Additionally, I have a case where I have a toolbar of icons (20+) that, when content is loading, these buttons are in a disabled state. Once the content loads, the buttons enabled. In this case, the console is spammed with 20+ warnings, making it extremely hard sift through console messages when developing.
Your Environment
Tech | Version |
---|---|
Material-UI | v1.1.0 |
React | 16.4.0 |
browser | Chrome |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:14
- Comments:8 (6 by maintainers)
Top GitHub Comments
The current behavior means that tooltips either break button group rendering or don’t work with disabled buttons in button groups.
Edit: an additional annoyance is that the warning can’t be suppressed.
If I can figure out how to contribute to the docs I can spend some time tomorrow.
On Mon, Jul 23, 2018, 13:48 Olivier Tassinari notifications@github.com wrote: