From b119de6a116520a23a5333a4c975a27413e3fe3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E8=89=B3=E5=85=B5?= Date: Tue, 17 Mar 2026 18:52:51 +0800 Subject: [PATCH] fix: forward textarea semantic styles and correct typings --- package.json | 2 +- src/TextArea.tsx | 1 + src/interface.ts | 2 +- tests/__snapshots__/index.spec.tsx.snap | 36 ++++++++++++++++++++++--- tests/index.spec.tsx | 18 +++++++++++++ 5 files changed, 53 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index ebf22e1..d8fb16c 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "coverage": "rc-test --coverage" }, "dependencies": { - "@rc-component/input": "~1.2.0", + "@rc-component/input": "~1.2.1", "@rc-component/resize-observer": "^1.0.0", "@rc-component/util": "^1.3.0", "clsx": "^2.1.1" diff --git a/src/TextArea.tsx b/src/TextArea.tsx index af2e233..5158dab 100644 --- a/src/TextArea.tsx +++ b/src/TextArea.tsx @@ -236,6 +236,7 @@ const TextArea = React.forwardRef( 'data-count': typeof dataCount === 'string' ? dataCount : undefined, }, }} + styles={styles} hidden={hidden} readOnly={readOnly} onClear={onClear} diff --git a/src/interface.ts b/src/interface.ts index 476d49a..bd62e32 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -31,7 +31,7 @@ export type TextAreaProps = Omit & { textarea?: string; count?: string; }; - styles?: { + styles?: CommonInputProps['styles'] & { textarea?: CSSProperties; count?: CSSProperties; }; diff --git a/tests/__snapshots__/index.spec.tsx.snap b/tests/__snapshots__/index.spec.tsx.snap index 2e02281..7a5a108 100644 --- a/tests/__snapshots__/index.spec.tsx.snap +++ b/tests/__snapshots__/index.spec.tsx.snap @@ -2,10 +2,38 @@ exports[`TextArea classNames and styles should work 1`] = `
- + + + suffix + + 3 + + + { const { container } = render( <>