Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Input.TextArea support rootClassName #44058

Merged
merged 4 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions components/input/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface TextAreaProps extends Omit<RcTextAreaProps, 'suffix'> {
bordered?: boolean;
size?: SizeType;
status?: InputStatus;
rootClassName?: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个原来不支持的么?demo test 里加个 TextArea 的测试~~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image 不支持,之前因为没有加 test 所以没检测出来,我加一下 test

}

export interface TextAreaRef {
Expand All @@ -39,6 +40,8 @@ const TextArea = forwardRef<TextAreaRef, TextAreaProps>((props, ref) => {
allowClear,
showCount,
classNames: classes,
rootClassName,
className,
...rest
} = props;
const { getPrefixCls, direction } = React.useContext(ConfigContext);
Expand Down Expand Up @@ -87,6 +90,7 @@ const TextArea = forwardRef<TextAreaRef, TextAreaProps>((props, ref) => {
{...rest}
disabled={mergedDisabled}
allowClear={mergedAllowClear}
className={classNames(className, rootClassName)}
classes={{
affixWrapper: classNames(
`${prefixCls}-textarea-affix-wrapper`,
Expand Down
4 changes: 4 additions & 0 deletions components/input/__tests__/demo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ rootPropsTest(
rootPropsTest('input', (Input, props) => <Input.Password {...props} />, {
name: 'password',
});

rootPropsTest('input', (Input, props) => <Input.TextArea {...props} />, {
name: 'textarea',
});