Skip to content

Allow tooltips to function on disabled elements #11601

@mririgoyen

Description

@mririgoyen

Currently, 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: #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

Metadata

Metadata

Labels

docsImprovements or additions to the documentation.good first issueGreat for first contributions. Enable to learn the contribution process.scope: tooltipChanges related to the tooltip.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions