Sage / carbon

Carbon by Sage | ReactJS UI Component Library
https://carbon.sage.com
Apache License 2.0
277 stars 86 forks source link

Allow 1 row height for TextArea component #6954

Open harryharford opened 2 weeks ago

harryharford commented 2 weeks ago

Description

On https://github.com/Sage/carbon/issues/6860 a change was made to make minHeight configurable for the TextArea component, this goes some way to allowing the component to align with other similar text inputs.

Unfortunately, with the rows prop set to 1 - the minimum number of text rows is still 2. image

This means the component can still not easily be used alongside others like TextBox due to the height and rows difference.

Suggested solution

Allow 1 row of text in the TextArea component. After 1 row the field could expand or be scrollable.

Demo URL

No response

Alternatives

No response

Additional context

@ljemmo Has confirmed that this requirement would be fine as long as the a default is set.

Worth noting that since rows: 1 is already supported but restricts to a 2 row minimum, a different value may need to be used to actually support just 1 row without being a breaking change for those who have already implemented with 1.

Confidentiality

nuria1110 commented 6 days ago

FE-6811