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 does not disappear when button is disabled #9581
Comments
@Sokal21 You can control whether the tooltip disappears or not with the |
Hello @Sokal21. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro. Issues labeled by |
@dengfuping I need the tooltip to be displayed even when the button is disabled |
Did you notice that everything works well with an inline |
@cloudever Yes I realized, but I need to use the styled-component wrapper. |
Try this as workaround: https://codesandbox.io/s/nkwv5l9k40 |
@afc163 The problem exists still. Maybe we should to make |
const StyledButton = styled(Button)`
width: 300px;
`;
+ StyledButton.__ANT_BUTTON = true; |
如果是 checkbox呢? |
@afc163 |
Experiencing same issue as well in our application. You have to re-hover over it to remove |
@codercatmomi It's the same as above. ant-design/components/tooltip/index.tsx Line 124 in ad72111
|
Does adding |
This comment has been minimized.
This comment has been minimized.
I fixed this problem with react-component/tooltip#18 (comment).
|
It worked for me, thank you! |
This workaround this causes the tooltip to not show at all for me(when the child component is a disabled Switch). |
It worked for select[disabled] as well. Thank you! |
Here is a workaround <Tooltip title={!disabled ? "Tooltip" : null}>
<Button
type="primary"
disabled={disabled}
>
Tooltip Button
</Button>
</Tooltip> |
nice in my case |
Version
3.2.3
Environment
Chrome
Reproduction link
https://codesandbox.io/s/64zprz4vmn
Steps to reproduce
Pass the mouse over the button, and then take it out without passing it over the tooltip
What is expected?
The tooltip should disappear
What is actually happening?
the tooltip stays opened
I'm using styled-components to make styles for my components, I'm creating a custom styled components from an antd Button. The problem is that when this button is disabled and I hover over the button the tooltip does not go away. The issue is related to this specific line: https://github.com/ant-design/ant-design/blob/master/components/tooltip/index.tsx#L121 , here you cant identify that is an antd Button or a coomon button because we are using styled component.
The text was updated successfully, but these errors were encountered: