Implementing field sizing option in TextArea component - #8295
Implementing field sizing option in TextArea component#8295HiroAgustin with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: HiroAgustin <1458873+HiroAgustin@users.noreply.github.com>
🦋 Changeset detectedLatest commit: d415af7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@copilot rename prop fieldSizing to autoSize or something that makes more sense. Also update PR description. |
|
Co-authored-by: HiroAgustin <1458873+HiroAgustin@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds an opt-in autoSize prop to Textarea that enables CSS field-sizing: content so the control can grow with its content, along with supporting docs/stories/tests and a changeset.
Changes:
- Added
autoSize?: booleantoTextareaand exposed it viadata-auto-sizefor styling hooks. - Introduced a CSS Module rule applying
min-height: 1lhandfield-sizing: contentwhen autosizing is enabled. - Added Storybook controls/examples and docs metadata, plus a changeset entry.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/Textarea/Textarea.tsx | Adds the autoSize prop and renders a data-auto-size attribute to toggle styling. |
| packages/react/src/Textarea/Textarea.test.tsx | Adds a test verifying autosize styling and that resize behavior remains unchanged. |
| packages/react/src/Textarea/Textarea.stories.tsx | Adds autoSize to Playground args and controls. |
| packages/react/src/Textarea/TextArea.module.css | Adds the [data-auto-size='true'] rule to enable field-sizing: content. |
| packages/react/src/Textarea/Textarea.features.stories.tsx | Adds an AutoSize feature story example. |
| packages/react/src/Textarea/Textarea.docs.json | Documents the new autoSize prop. |
| .changeset/textarea-auto-size.md | Adds a changeset for the new autoSize option. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
Co-authored-by: HiroAgustin <1458873+HiroAgustin@users.noreply.github.com>
|
Integration test results from github/github-ui PR:
All checks passed! |
New
field-sizingprop is now baseline: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/field-sizing. It allows for input controls to grow as needed. This would be a great opt-in for textarea.https://www.youtube.com/watch?v=s48ueIHpG7A