diff --git a/.changeset/fuzzy-dancers-move.md b/.changeset/fuzzy-dancers-move.md new file mode 100644 index 00000000000..16e6cddd5c4 --- /dev/null +++ b/.changeset/fuzzy-dancers-move.md @@ -0,0 +1,5 @@ +--- +'@talend/design-system': patch +--- + +fix: allow form Textarea to changes number of rows and remove fixed css min-height diff --git a/packages/design-system/src/components/Form/Primitives/Textarea/Textarea.module.scss b/packages/design-system/src/components/Form/Primitives/Textarea/Textarea.module.scss index d5162abb077..645430f0a90 100644 --- a/packages/design-system/src/components/Form/Primitives/Textarea/Textarea.module.scss +++ b/packages/design-system/src/components/Form/Primitives/Textarea/Textarea.module.scss @@ -4,7 +4,6 @@ .textarea { @include Form.base-input(); @include Form.border-styles(); - min-height: calc(#{tokens.$coral-sizing-l} * 2); max-height: tokens.$coral-sizing-xxxl; resize: vertical; line-height: 140%; diff --git a/packages/design-system/src/components/Form/Primitives/Textarea/Textarea.tsx b/packages/design-system/src/components/Form/Primitives/Textarea/Textarea.tsx index 43f1962389c..fdccc55f350 100644 --- a/packages/design-system/src/components/Form/Primitives/Textarea/Textarea.tsx +++ b/packages/design-system/src/components/Form/Primitives/Textarea/Textarea.tsx @@ -1,13 +1,17 @@ import { forwardRef, Ref, TextareaHTMLAttributes } from 'react'; + import classnames from 'classnames'; + import styles from './Textarea.module.scss'; export type TextareaPrimitiveProps = TextareaHTMLAttributes & { hasError?: boolean }; const Textarea = forwardRef((props: TextareaPrimitiveProps, ref: Ref) => { const { className, readOnly = false, disabled = false, hasError = false, ...rest } = props; + const defaultRowsNumber = 3; return (