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:
杨小事er 2019-03-24 16:21:48 +08:00 committed by 偏右
parent 5d17a6e45a
commit a6a5e068eb

View File

@ -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`,