-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 #3608 by removing ternary and ensuring AntD FieldTemplate wraps root in Form.Item
#3621
Conversation
- Ensure the root field is always wrapped in Form.Item The original ternary expression has existed since the antd theme was added in rjsf-team#1561. I am not familiar enough with antd to know what, if any, undesirable effects this change could cause.
{id === 'root' ? ( | ||
children | ||
) : ( |
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.
The reason the error didn't show up is because the example in #3608 had a String field as the root, and the error rendering is handled by Form.Item
. Since there was no Form.Item
, there was no visible error message.
Nice fix. Have you figured out what is causing #3609? |
Co-authored-by: Heath C <[email protected]>
An internal call to |
Actually this fix could also eliminate the need for the label changes I made to Select (and maybe Checkboxes and Radiobutton) since the label is output as part of the item. And the bug was related to the root item not having labels. Meaning that #3594 can likely be fixed by reverting my changes to those components |
The extra TitleField for the SelectWidget can definitely be removed. I think the other widgets did need the new label added in your change, but I'll double-check |
The original ternary expression has existed since the antd theme was added in #1561. I am not familiar enough with antd to know what, if any, undesirable effects this change could cause. I looked at most of the playground examples and did not notice any new issues.
Checklist
npm run test:update
to update snapshots, if needed.