From d868c5a58edafbccf12bb24284dfbd1ffab05cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=87=AF?= Date: Sat, 20 Jan 2018 19:35:14 +0800 Subject: [PATCH] fix Input type error (#9046) --- components/input/Input.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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,