diff --git a/components/input/TextArea.tsx b/components/input/TextArea.tsx index e4d79a303f90..21a44e6dbd7a 100644 --- a/components/input/TextArea.tsx +++ b/components/input/TextArea.tsx @@ -21,6 +21,7 @@ export interface TextAreaProps extends Omit { bordered?: boolean; size?: SizeType; status?: InputStatus; + rootClassName?: string; } export interface TextAreaRef { @@ -39,6 +40,8 @@ const TextArea = forwardRef((props, ref) => { allowClear, showCount, classNames: classes, + rootClassName, + className, ...rest } = props; const { getPrefixCls, direction } = React.useContext(ConfigContext); @@ -87,6 +90,7 @@ const TextArea = forwardRef((props, ref) => { {...rest} disabled={mergedDisabled} allowClear={mergedAllowClear} + className={classNames(className, rootClassName)} classes={{ affixWrapper: classNames( `${prefixCls}-textarea-affix-wrapper`, diff --git a/components/input/__tests__/demo.test.tsx b/components/input/__tests__/demo.test.tsx index 4be9097dabce..999fcbc451fd 100644 --- a/components/input/__tests__/demo.test.tsx +++ b/components/input/__tests__/demo.test.tsx @@ -14,3 +14,7 @@ rootPropsTest( rootPropsTest('input', (Input, props) => , { name: 'password', }); + +rootPropsTest('input', (Input, props) => , { + name: 'textarea', +});