From 37a6ac5d0befc7fb746035a8b830da6f38360151 Mon Sep 17 00:00:00 2001 From: Geoffroy Baccarini Date: Thu, 10 Oct 2024 11:31:11 +0200 Subject: [PATCH] fix(TMC-25993): fix DS textarea row property and static css height --- .changeset/fuzzy-dancers-move.md | 5 +++++ .../Form/Primitives/Textarea/Textarea.module.scss | 1 - .../src/components/Form/Primitives/Textarea/Textarea.tsx | 4 ++++ .../stories/form/Field/Textarea/Input.Textarea.stories.tsx | 6 ++++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changeset/fuzzy-dancers-move.md 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 (