-
Notifications
You must be signed in to change notification settings - Fork 646
Textarea: Add minHeight and maxHeight as props
#6182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 796a32c 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 |
|
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for customizing the textarea’s height by introducing minHeight and maxHeight props.
- Adds
minHeightandmaxHeightto theTextareaPropsand applies them via inline styles - Updates tests and stories to cover the new props
- Documents the new props and includes a changeset for a minor release
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/Textarea/Textarea.tsx | Added minHeight/maxHeight props and style handling |
| packages/react/src/Textarea/Textarea.test.tsx | Added tests for minHeight and maxHeight styles |
| packages/react/src/Textarea/Textarea.features.stories.tsx | Added feature stories showcasing the new props |
| packages/react/src/Textarea/Textarea.docs.json | Documented the new props in the generated JSON docs |
| .changeset/social-ants-bow.md | Created changeset for a minor release |
Comments suppressed due to low confidence (1)
packages/react/src/Textarea/Textarea.tsx:40
- Consider allowing both string and number types for CSS flexibility (e.g. '2rem', '50%') by typing
minHeight/maxHeightasCSSProperties['minHeight']instead ofnumberonly.
minHeight?: number
| rows={rows} | ||
| cols={cols} | ||
| className={classes.TextArea} | ||
| style={{ |
Copilot
AI
Jun 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] User-supplied style props may override these height settings; consider merging existing rest.style first (e.g. style={{ ...rest.style, minHeight, maxHeight }}) to avoid unintentional overrides.
| style={{ | |
| style={{ | |
| ...rest.style, |
| /** | ||
| * The minimum height of the Textarea | ||
| */ | ||
| minHeight?: number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use small/medium/large/xlarge instead? 🤔 CC: @langermank
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, I feel like with a field its just going to be sooo specific to the use case
|
I noticed that we directly expose e.g. we could do (cc: @langermank, @francinelucca) |
|
if we're not going to "Standardize" the sizes then I feel better with opting for just the existing style prop for these type of changes, i.e. no changes needed. But will defer to @langermank for final call |
|
I feel like it makes sense here as a prop since its a common attribute for text fields. Might as well make it easier to adjust at the prop level. |
size-limit report 📦
|
Closes https://github.com/github/primer/issues/5296
Adds new props
minHeightandmaxHeightto theTextarea. This allows you to customize the min/max height of the textarea directly.Changelog
New
minHeightandmaxHeightprops toTextareaRollout strategy
Testing & Reviewing
Merge checklist