react icon indicating copy to clipboard operation
react copied to clipboard

Textarea: Add `minHeight` and `maxHeight` as props

Open TylerJDev opened this issue 5 months ago • 4 comments

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 minHeight and maxHeight props to Textarea

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)

TylerJDev avatar Jun 09 '25 13:06 TylerJDev

🦋 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

changeset-bot[bot] avatar Jun 09 '25 13:06 changeset-bot[bot]

: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!

github-actions[bot] avatar Jun 09 '25 14:06 github-actions[bot]

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)

TylerJDev avatar Jun 09 '25 14:06 TylerJDev

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

francinelucca avatar Jun 09 '25 14:06 francinelucca

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.

langermank avatar Jun 24 '25 18:06 langermank

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% 🔺)

github-actions[bot] avatar Jun 25 '25 14:06 github-actions[bot]