react
react copied to clipboard
Textarea: Add `minHeight` and `maxHeight` as props
Closes https://github.com/github/primer/issues/5296
Adds new props minHeight and maxHeight to the Textarea. This allows you to customize the min/max height of the textarea directly.
Changelog
New
- Added
minHeightandmaxHeightprops toTextarea
Rollout strategy
- [ ] Patch release
- [x] Minor release
- [ ] Major release; if selected, include a written rollout or migration plan
- [ ] None; if selected, include a brief description as to why
Testing & Reviewing
Merge checklist
- [x] Added/updated tests
- [x] Added/updated documentation
- [x] Added/updated previews (Storybook)
- [x] Changes are SSR compatible
- [x] Tested in Chrome
- [ ] Tested in Firefox
- [ ] Tested in Safari
- [ ] Tested in Edge
- [ ] (GitHub staff only) Integration tests pass at github/github (Learn more about how to run integration tests)
🦋 Changeset detected
Latest commit: 796a32c764949b755172209a8c33f36f5c52d239
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @primer/react | Minor |
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
:wave: 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!
I noticed that we directly expose style on the textarea, as the ...rest allows for pretty much anything (style included). I'm wondering if this change is still worth it?
e.g. we could do <Textarea style={{minHeight: 100}} /> to get the same effect. Curious what y'all think
(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 📦
| Path | Size |
|---|---|
| packages/react/dist/browser.esm.js | 92.45 KB (-0.25% 🔽) |
| packages/react/dist/browser.umd.js | 92.72 KB (+0.19% 🔺) |