Skip to content

Commit

Permalink
fix(TMC-25993): fix DS textarea row property and static css height
Browse files Browse the repository at this point in the history
  • Loading branch information
Gbacc committed Oct 10, 2024
1 parent 4eacbe7 commit 37a6ac5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-dancers-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/design-system': patch
---

fix: allow form Textarea to changes number of rows and remove fixed css min-height
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { forwardRef, Ref, TextareaHTMLAttributes } from 'react';

import classnames from 'classnames';

import styles from './Textarea.module.scss';

export type TextareaPrimitiveProps = TextareaHTMLAttributes<any> & { hasError?: boolean };

const Textarea = forwardRef((props: TextareaPrimitiveProps, ref: Ref<HTMLTextAreaElement>) => {
const { className, readOnly = false, disabled = false, hasError = false, ...rest } = props;
const defaultRowsNumber = 3;
return (
<textarea
rows={defaultRowsNumber}
{...rest}
ref={ref}
disabled={disabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export const Textarea = () => (
hasError
description="There is an error here"
/>
<Form.Textarea
rows={2}
placeholder="Placeholder"
name="time"
label="Textarea with custom number of rows"
/>
</StackVertical>
);

Expand Down

0 comments on commit 37a6ac5

Please sign in to comment.