diff --git a/components/input/Input.tsx b/components/input/Input.tsx index fd9df23a66..4a441872a1 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -28,7 +28,7 @@ export interface InputProps extends AbstractInputProps { id?: number | string; name?: string; size?: 'large' | 'default' | 'small'; - maxLength?: number; + maxLength?: number | string; disabled?: boolean; readOnly?: boolean; addonBefore?: React.ReactNode; @@ -65,7 +65,10 @@ export default class Input extends React.Component { PropTypes.number, ]), size: PropTypes.oneOf(['small', 'default', 'large']), - maxLength: PropTypes.string, + maxLength: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.number, + ]), disabled: PropTypes.bool, value: PropTypes.any, defaultValue: PropTypes.any,