-
Notifications
You must be signed in to change notification settings - Fork 536
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
Let FormControl accept any input #1968
Conversation
… spot we'd normally render a Primer input component
🦋 Changeset detectedLatest commit: aa500e9 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 |
size-limit report 📦
|
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.
👏
…nto mp/form-control-any-input
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.
Minor changes requested in docs, the code looks good!
Approving in advance :)
Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com>
@@ -183,13 +175,8 @@ const FormControl = React.forwardRef<HTMLDivElement, FormControlProps>( | |||
display="flex" | |||
flexDirection="column" | |||
width="100%" | |||
sx={{...(isLabelHidden ? {'> *:not(label) + *': {marginTop: 2}} : {'> * + *': {marginTop: 2}}), ...sx}} | |||
sx={{...(isLabelHidden ? {'> *:not(label) + *': {marginTop: 1}} : {'> * + *': {marginTop: 1}}), ...sx}} |
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.
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.
* 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 <siddharthkp@github.com> * addresses PR feedback Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com>
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
namespaceCloses #1964
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.