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.

Tooltip on disabled buttons not working

See original GitHub issue

Description

When there is a tooltip wrapping a disabled button, the tooltip is disabled as well. If you separate the tooltip from the button by adding a Box or using shouldWrapChildren, the tooltip works again. However, if the button is part of a button group, this causes it to disconnect from the group and lose the proper border radius.

Link to Reproduction

https://codesandbox.io/s/zealous-wind-lysbr

Steps to reproduce

There are four buttons/button groups set up, demonstrating the different cases I have come across.

The first demonstrates a tooltip on a disabled button, which does not work. The second demonstrates a tooltip on a disabled button with shouldWrapChildren, which works. The third is a group showing a tooltip on an enabled button working, and a disabled button not working. The fourth is a group showing a disabled button with a shouldWrapChildren tooltip, demonstrating the border radius issue.

Chakra UI Version

1.8.1

Browser

Firefox 96.0.3

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

image

My current workaround is to manually set the border radius back to 0 on the appropriate sides of the first 3 buttons where the issue is occurring.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
TimKolbergercommented, Feb 5, 2022

Duplicate of #2849 @nikolovlazar is this a candidate for the FAQ?

0reactions
chrysbcommented, Sep 6, 2022

They don’t seem interested in fixing this one for some reason. I would just manually set the border radius if it is not too much work for your use-case, personally.

Thanks for the reply! It also changes the size of the button. I only wrapped the middle one here, if I wrapped all 3 it would be a mess. I ended up just overriding isDisabled and disabling the buttons manually instead of using isDisabled — I think that’s a more extensible approach

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
Add a disabled element like the button element into a div whose display style is set to inline-block . · Set the pointer...
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 >
Disabled element won't show tooltip · Issue #304 - GitHub
The tooltip won't show if button is disabled. ... Same issue here, but it only occurs with (disabled) buttons, not all elements.
Read more >
How to enable Bootstrap tooltip on disabled button - Edureka
I need to display a tooltip on a disabled button and remove it on an enabled button. Currently, it works in reverse.
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