🐛 Fix Input.Password lost focused state issue

close #15173
This commit is contained in:
afc163 2019-03-04 21:54:51 +08:00
parent 6f22eaa2c4
commit eaadf94861
No known key found for this signature in database
GPG Key ID: 5F00908D72002306

View File

@ -44,6 +44,11 @@ export default class Password extends React.Component<PasswordProps, PasswordSta
className: `${prefixCls}-icon`,
type: this.state.visible ? 'eye-invisible' : 'eye',
key: 'passwordIcon',
onMouseDown: (e: MouseEvent) => {
// Prevent focused state lost
// https://github.com/ant-design/ant-design/issues/15173
e.preventDefault();
},
};
return <Icon {...iconProps} />;
}