mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
fix(Input): fix password prop action (#15598)
* fix(Input): fix password prop action * fix(InputPassword): add assert action is non-null
This commit is contained in:
parent
5d17a6e45a
commit
a6a5e068eb
@ -5,7 +5,7 @@ import Icon from '../icon';
|
||||
|
||||
export interface PasswordProps extends InputProps {
|
||||
readonly inputPrefixCls?: string;
|
||||
readonly action: string;
|
||||
readonly action?: string;
|
||||
visibilityToggle?: boolean;
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ export default class Password extends React.Component<PasswordProps, PasswordSta
|
||||
|
||||
getIcon() {
|
||||
const { prefixCls, action } = this.props;
|
||||
const iconTrigger = ActionMap[action] || '';
|
||||
const iconTrigger = ActionMap[action!] || '';
|
||||
const iconProps = {
|
||||
[iconTrigger]: this.onChange,
|
||||
className: `${prefixCls}-icon`,
|
||||
|
Loading…
Reference in New Issue
Block a user