Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip and Popover do not work on disabled buttons in Chrome-based browsers #36283

Closed
mathieucaroff opened this issue Jun 28, 2022 · 6 comments

Comments

@mathieucaroff
Copy link

mathieucaroff commented Jun 28, 2022

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Use a disabled button inside as child of a Tooltip or Popover.
Hover over the button with the mouse.

What is expected?

The Tooltip box or Popover box should appear.

What is actually happening?

Most of the time, nothing happens.

Environment Info
antd 4.15.1
React 17.0.2
System Windows 10 and MacOS 12.2.1
Browser Chrome 103.0 as well as Edge and Safari

This bug does not affect Firefox. This bug shows in Storybook.

Similar issues:

The solution proposed in issue 30191 of wrapping the button in a div does not work.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 28, 2022

@mathieucaroff
Copy link
Author

I'm hardly able to reproduce this issue consistently, even in the Storybook, I'm not sure what's going on :T

@Mzhang1994
Copy link

I'm hardly able to reproduce this issue consistently, even in the Storybook, I'm not sure what's going on :T

I think it will happen when you move mouse from a tooltipless one to a tooltip one directly. No matter it is a disabled one or not.

@afc163
Copy link
Member

afc163 commented Jun 29, 2022

Resolved this issue in

// Fix Tooltip won't hide at disabled button
// mouse events don't trigger at disabled button in Chrome
// https://github.com/react-component/tooltip/issues/18
function getDisabledCompatibleChildren(element: React.ReactElement<any>, prefixCls: string) {
, cannot reproduce in your codesandbox.

图片

@shamseerahammedm
Copy link

+1 getting same issue on "antd": "^5.1.5",, popover not coming when wrapped in disabled buttons

<Popover content={<div>Reject</div>} placement="bottom">
 <Button 
   onClick={() => somefunction(rowSelectionModel)}
   disabled={true}
 >
   Reject
 </Button>
</Popover>

@sawhil
Copy link

sawhil commented May 26, 2024

+1 getting same issue on "antd": "^5.1.5",, popover not coming when wrapped in disabled buttons

<Popover content={<div>Reject</div>} placement="bottom">
 <Button 
   onClick={() => somefunction(rowSelectionModel)}
   disabled={true}
 >
   Reject
 </Button>
</Popover>

Wrap the button in a div. It should work. Hover events are disabled when the button is disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants