Skip to content

Conversation

@mperrotti
Copy link
Contributor

Instead of rendering unexpected* FormControl children before the other children, we render them in the same spot we'd normally render an input.

* any component that is not a Primer input component or not in the FormControl namespace

Closes #1964

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@mperrotti mperrotti requested review from a team and pksjce March 16, 2022 14:12
@changeset-bot
Copy link

changeset-bot bot commented Mar 16, 2022

🦋 Changeset detected

Latest commit: aa500e9

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 Patch

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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2022

size-limit report 📦

Path Size
dist/browser.esm.js 63.19 KB (-0.34% 🔽)
dist/browser.umd.js 63.54 KB (-0.34% 🔽)

Copy link
Contributor

@dusave dusave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Copy link
Member

@siddharthkp siddharthkp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes requested in docs, the code looks good!

Approving in advance :)

Co-authored-by: Siddharth Kshetrapal <[email protected]>
flexDirection="column"
width="100%"
sx={{...(isLabelHidden ? {'> *:not(label) + *': {marginTop: 2}} : {'> * + *': {marginTop: 2}}), ...sx}}
sx={{...(isLabelHidden ? {'> *:not(label) + *': {marginTop: 1}} : {'> * + *': {marginTop: 1}}), ...sx}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has nothing to do with accepting different input components.
I looked at this with fresh eyes and thought the elements were spaced too far apart.

@mperrotti mperrotti merged commit 1b01485 into main Mar 16, 2022
@mperrotti mperrotti deleted the mp/form-control-any-input branch March 16, 2022 20:40
@primer-css primer-css mentioned this pull request Mar 16, 2022
pksjce pushed a commit that referenced this pull request Mar 17, 2022
* renders any non-FormControl components passed into FormControl in the spot we'd normally render a Primer input component

* adds changeset

* appease the linter

* Update docs/content/FormControl.mdx

Co-authored-by: Siddharth Kshetrapal <[email protected]>

* addresses PR feedback

Co-authored-by: Siddharth Kshetrapal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FormControl does not support custom components

4 participants