question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow tooltips to function on disabled elements

See original GitHub issue

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: 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:closed
  • Created 5 years ago
  • Reactions:14
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
sliktscommented, Oct 9, 2019

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.

2reactions
kamranayubcommented, Jul 23, 2018

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:

@kamranayub https://github.com/kamranayub Let’s document it 👍

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mui-org/material-ui/issues/11601#issuecomment-407161850, or mute the thread https://github.com/notifications/unsubscribe-auth/AAiaayqtG3zvBAEnlzYeO94FvF6l4okEks5uJhp1gaJpZM4UPIKT .

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to enable Bootstrap tooltip on disabled button?
This can be done via CSS. The "pointer-events" property is what's preventing the tooltip from appearing.
Read more >
How to Show tooltip on disabled elements and ... - Syncfusion
By default, Tooltips will not be displayed on disabled elements. However, it is possible to enable this behavior by following the steps below....
Read more >
How to enable Bootstrap tooltip on disabled button
To trigger tooltip on disabled button by wrapping them in <span> span tag and <div> div tag and then adding 'data-toggle','data-placement' and ' ......
Read more >
Allow tooltips to function on disabled elements #11601 - GitHub
When a tooltip is assigned to a disabled item, the tooltip works like normal. No console warnings or errors are produced. Current Behavior....
Read more >
How to Enable Angular Material Tooltips Over Disabled Buttons
A solution to this issue is adding matTooltip to either a child or a parent element. It really depends on your personal preference...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found