-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
mouseleave don't trigger on disabled inputs and button #18
Comments
use this instead <Tooltip title="mouseleave is not work">
<span><button disabled>button text</button></span>
</Tooltip> |
对了这个地方 貌似 每次POP 起来 点DOCUMENT 空白消失的情况第一次都没问题,第二次 都提示 this.popupInstance.getPopupDomNode is not a function 第一次都是可以的,我这里用的REACT 1.4 RC |
+1, any work arounds? |
好像和这个相关 facebook/react#5762 |
同样碰到这个问题。暂时用这样的方式解决了:
不知道有没有更好的办法 |
貌似现在加 span 的方式也不好使了:http://codepen.io/anon/pen/xRWRRY?editors=001 |
@afc163 是的 我试了加span也无效 |
how to add tooltip directly on table row |
@jennifer-shehane is there a reason why this works? Or was it through trial and error? |
Yeah, just trial and error. 😄 |
+1 |
+1 |
+1 |
Workaround:
<Tooltip title="Tooltip Title">
<span style={{ cursor: disabled ? 'not-allowed' : 'pointer' }}>
<button disabled={disabled} style={{ pointerEvents: 'none' }}>
button text
</button>
</span>
</Tooltip> I've used @sandwich99's comment and @jennifer-shehane's workaround (big thanks!!) @jennifer-shehane Correct me if I am wrong, but using your solution breaks the non-disabled state, the button stops showing |
For those who cannot modify the or add a parent element:
For example:
By disabling |
你这个方法,如果鼠标移开快一点的话,是不生效的; |
If any of you guys are using import styled from 'styled-components';
import { Button, Tooltip } from 'antd';
const StyledButton = styled(Button)`
pointer-events: ${({ disabled }) => disabled ? 'none' : 'auto'};
`;
const StyledButtonWrapper = styled.span`
cursor: ${({ disabled } : { disabled: boolean }) => disabled ? 'not-allowed' : 'pointer'};
`;
interface BugFreeButtonWithTooltipInterface {
disabled: boolean;
// other props...
}
const BugFreeButtonWithTooltip: React.FC<BugFreeButtonWithTooltipInterface> = props => (
<Tooltip placement="left" title="this is a bug free disabled/enabled button with tooltip">
<StyledButtonWrapper disabled={props.disabled}>
<StyledButton {...props} />
</StyledButtonWrapper>
</Tooltip>
);
export default BugFreeButtonWithTooltip; |
thanks a lot! it really helps me |
Here is a workaround <Tooltip title={!disabled ? "Tooltip" : null}>
<button
type="primary"
disabled={disabled}
>
Tooltip Button
</button>
</Tooltip> |
I'm facing an issue with Tooltips not getting triggered when the InputPassword component is placed inside a Form and is disabled. The isLockedOrUnauthorized condition determines whether the InputPassword should be disabled or not. Unfortunately, when the input is disabled, the Tooltips do not show up upon hover, which prevents users from receiving additional information when their input is locked or unauthorized. Steps to Reproduce:
Expected Behavior: Code Snippet:
Environment: Browser version: Chrome Version 114.0.5735.198 (Official Build) (x86_64) Any insights or help on resolving this issue would be greatly appreciated. Thank you! |
react-bootstrap/react-bootstrap#1254
The text was updated successfully, but these errors were encountered: