Skip to content

Commit

Permalink
docs: Add guidance for modifying textarea's height.
Browse files Browse the repository at this point in the history
  • Loading branch information
sopranopillow committed Oct 19, 2023
1 parent 4ac68a6 commit c4272ea
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

- **Consider using `Textarea` with outline appearance.** When the contrast ratio against the immediate surrounding color is less than 3:1, consider using outline styles which has a bottom border stroke. But please ensure the color of bottom border stroke has a sufficient contrast which is greater than 3 to 1 against the immediate surrounding.
- Prefer using `<Field>` instead of `<Label>` to handle accessibility automatically.
- **When changing height related styles, apply them directly to the textarea slot like this: `<Textarea textarea={{ className: yourClassName }} />`.** This is needed due to the structure of the Textarea being a span wrapping the textarea native element and resizing based on the textarea element. It is also important to note that we add a default `maxHeight` so when typing text, a scrollbar will appear when the text becomes too long for the size of the Textarea. To remove this constraint, resetting the `maxHeight` prevents this issue as well as letting the textarea wrapper fully resize based on the textarea's size.

### Don't

Expand Down

0 comments on commit c4272ea

Please sign in to comment.