-
Notifications
You must be signed in to change notification settings - Fork 257
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
fix(field): making description show up #3675
Conversation
🦋 Changeset detectedLatest commit: fe6dab9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
@@ -50,11 +50,12 @@ const FieldPrimitive: Primitive<FieldPrimitiveProps, typeof Flex> = ( | |||
{...rest} | |||
> | |||
{label ? <Label visuallyHidden={labelHidden}>{label}</Label> : null} | |||
{descriptiveText ? ( |
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.
Wait, why remove this logic? Shouldn't descriptiveText be provided to show the descriptive text?
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.
+1
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.
That logic is IN <FieldDescription>
: https://github.com/aws-amplify/amplify-ui/blob/main/packages/react/src/primitives/Field/FieldDescription.tsx#L15
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.
but why did that cause a bug?
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 didn't cause the bug, the bug was I was passing it as a child instead of prop
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.
Thank you for adding tests!
Description of changes
Field description wasn't showing up for the internal Field component. This fixes that.
Issue #, if available
Description of how you validated changes
Added tests
Checklist
yarn test
passessideEffects
field updatedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.