diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fe937d639..f136f4dd19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,12 @@ should change the heading of the (upcoming) version to include a major version b --> +# 5.6.3 + +## @rjsf/antd + +- Fix [#3608](https://github.com/rjsf-team/react-jsonschema-form/issues/3608) by ensuring the root field is always wrapped in Form.Item + # 5.6.2 ## Dev / docs / playground diff --git a/packages/antd/src/templates/FieldTemplate/index.tsx b/packages/antd/src/templates/FieldTemplate/index.tsx index 0d411db8fe..d9ae01a9c9 100644 --- a/packages/antd/src/templates/FieldTemplate/index.tsx +++ b/packages/antd/src/templates/FieldTemplate/index.tsx @@ -94,25 +94,21 @@ export default function FieldTemplate< uiSchema={uiSchema} registry={registry} > - {id === 'root' ? ( - children - ) : ( - - {children} - - )} + + {children} + ); } diff --git a/packages/antd/test/__snapshots__/Array.test.tsx.snap b/packages/antd/test/__snapshots__/Array.test.tsx.snap index e3a6192ec0..dfa4b9ff37 100644 --- a/packages/antd/test/__snapshots__/Array.test.tsx.snap +++ b/packages/antd/test/__snapshots__/Array.test.tsx.snap @@ -9,92 +9,114 @@ exports[`array fields array 1`] = `
-
- -
- +
+
+ +
+
+
+
+
- + + + + - - - - -
-
- - - - -
-
- -
-
-
-
-
- - - - +
+
+
+
+ + + + +
+
+
+
+
+
+
+
+
+ + + +
-
-
-
-
-
- - - - -
-
- - -
-
-
- +
+ +
+
+
+
+ - + - -`; - -exports[`array fields empty errors array 1`] = ` -
-
-
-
- -
-
-
-
- -
-
- - + aria-hidden={true} + className="ant-select-selection-search-mirror" + > + +   + +
+
- + +
+`; + +exports[`array fields fixed array 1`] = ` +
+
+
+
+
-
+
- - - - - - - - - - + +
+
+
+
+
+
+
+
+
+
+
+
- +
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+ +
+
+
-
-
+
- + - - - - - - - -
-`; - -exports[`with title and description array icons 1`] = ` -
-
-
-
-
- -
-
- - a test description - -
-
-
-
-
-
- -
-
-
-
- - - - -
-
-
- - a test item description - -
-
-
-
-
-
-
-
- - -
+
- - - - -
+
- - - - -
-
-
-
-
-
-
+ />
- -
-
-
- - + -
-
-
- - a test item description - +
-
-
-
-
- - - - -
+
- -
-
- -
+ a test description +
- + -
-`; - -exports[`with title and description fixed array 1`] = ` -
-
-
-
-
- -
-
- - a test description - -
-
-
-
-
-
- -
+ Test field + +
+
+ + a test description + +
+
- +
+
+ +
+
+
+
+ + + + +
+
+
+ + a test item description + +
+
+
+
+
+
+
+
+ + + +
-
- - a test item description - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- - +
+
+
+
- - - - + +
+
+
- + a test item description - +
-
+
+
+
+
+
+
-
+ + + +
+ aria-label="arrow-down" + className="anticon anticon-arrow-down" + role="img" + > + + + + +
+
+
+
+
- - a test item description - + + + +
-
+
+
+ + a test description + +
- + +
+
+ + + +   + +
+
+ + + + +
+ + a test description + +
- + + +`; + +exports[`with title and description from both array 1`] = ` +
+
+
+
+
+
-
- - -
+
- - - - -
+
- - - - -
-
-
-
-
-
-
+ />
- -
-
-
- - + -
-
-
- - a fancier item description - +
-
-
-
-
- - - - -
+
-
-
-
- -
+ a fancier description +
- +
-
-`; - -exports[`with title and description from both fixed array 1`] = ` -
-
-
-
-
- -
-
- - a fancier description - -
-
-
-
-
-
- -
+ My Field + +
+
+ + a fancier description + +
+
- +
+
+ +
+
+
+
+ + + + +
+
+
+ + a fancier item description + +
+
+
+
+
+
+
+
+ + + +
-
- - a fancier item description - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- - +
+
+
+
- - - - + +
+
+
- + a fancier item description - +
-
+
+
+
+
+
+ +
-
+ + + +
+ aria-label="copy" + className="anticon anticon-copy" + role="img" + > + + + +
+
+
+
+
- - a fancier item description - + + + +
-
+
+
+ + a fancier description + +
- + +
+
+ + + +   + +
+
+ + + + +
+ + a fancier description + +
- + - - - - - - -
-
-
-
-
-
- +
+
+ +
+
+
+
+ + + + +
+
+
+ + a fancier item description + +
+
+
+
+
+
- - - - +
+
+ +
+
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+ +
+
+
+
+ + a fancier item description + +
+
+
+
-
- - a fancier item description - -
- - -
-
- - - - -
+
- -
-
- -
+ a fancier description +
- + + + + + + +
+ + a fancier description + +
- @@ -4897,7 +4602,7 @@ exports[`with title and description from uiSchema checkboxes 1`] = ` `; -exports[`with title and description from uiSchema fixed array 1`] = ` +exports[`with title and description from uiSchema array icons 1`] = `
-
- -
-
- - a fancier description - -
-
-
-
- -
+ My Field + +
+
+ + a fancier description + +
+
- +
+
+ +
+
+
+
+ + + + +
+
+
+ + a fancier item description + +
+
+
+
+
+
+
+
+ + + +
-
- - a fancier item description - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- - +
+
+
+
- - - - + +
+
+
- + a fancier item description - -
-
- +
-
- - a fancier item description - -
-
-
-
-
-
-
-
- -
- - -
-`; - -exports[`with title and description with global label off array 1`] = ` -
-
-
-
-
-
-
-
+ + + + +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
-
- -
+ a fancier description +
- + +
+`; + +exports[`with title and description from uiSchema fixed array 1`] = ` +
+
+
+
+
+
-
- - -
+
- - - - -
+
+
+
+
+
+
+
+ +
+
+
+
+ + + + +
+
+
+ + a fancier item description + +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+ +
+
+
+
+ + a fancier item description + +
+
+
+
+
+
+
+
+
+ +
+
+
+ + a fancier description + +
+
+
+
+ + +
+`; + +exports[`with title and description with global label off array 1`] = ` +
+
+
+
+
+
+
+
+
- +
+
+
- - - -
+
+ +
+
+
+
+
+ + a test description + +
+
+
+
+
+ +
+`; + +exports[`with title and description with global label off array icons 1`] = ` +
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+ + + + +
+
+
+ + a test item description + +
+
+
+
+
+
+
+
+ + + + +
+
+
+
+
+
+
+
+
+
+
+ + + + +
+
+
+ + a test item description + +
+
+
+
+
+
+
+
+ + + + +
+
+
+
+
-
- - + -
-
-
- - a test item description - +
-
-
-
-
- - - - -
+
-
-
-
- -
+ a test description +
- +
@@ -6102,300 +6769,331 @@ exports[`with title and description with global label off fixed array 1`] = `
-
-
-
-
+
+
- - - - +
+
+
+
+ + + + +
+
+
+ + a test item description + +
+
+
+
-
- - a test item description - -
-
-
-
-
-
-
-
-
-
-
- - -
+ + + + + + + + + + +
+
+ +
+
+ - - - - +
+
+
- + a test item description - -
-
- +
-
-
- - a test item description - -
-
+
+
+ + a test description + +
- + -
-`; - -exports[`single fields format date 1`] = ` -
+
+
+
+
+ + + + +
+
+
+
+ + + +
+`; + +exports[`single fields format date 1`] = ` +
- - - - - - +
+
+ + + + + + +
+
+
+
+ @@ -789,57 +975,79 @@ exports[`single fields format datetime 1`] = ` className="form-group field field-string" >
- - - - - - +
+
+ + + + + + +
+
+
+
+ @@ -865,24 +1073,56 @@ exports[`single fields format time 1`] = `
- +
+
+
+
+
+ + + + +
+
+
+
+
+
+`; + +exports[`single fields select field multiple choice 1`] = ` +
+
+
+
- - - - +
+
+
+
+
+
+ + + +   + +
+
+
+ +
+
+
+
+
+
+
+`; + +exports[`single fields select field multiple choice formData 1`] = ` +
+
+
+
+
+
+
- - - -   - +
+
+
+ + + foo + + + + + + + +
+
+ + + bar + + + + + + + +
+
+
+ + + +   + +
+
+
+
+
-
@@ -1820,7 +2755,7 @@ exports[`single fields select field multiple choice 1`] = `
`; -exports[`single fields select field multiple choice enumDisabled 1`] = ` +exports[`single fields select field multiple choice with labels 1`] = `
- - - -   - +
+
+
+
+ + + +   + +
+
+
+ +
+
-
@@ -1933,211 +2890,124 @@ exports[`single fields select field multiple choice enumDisabled 1`] = `
`; -exports[`single fields select field multiple choice formData 1`] = ` +exports[`single fields select field single choice enumDisabled 1`] = `
- - - foo - - - - - - - -
-
- - - bar - - + + + + +
- + + - - -
-
-
- - - -   - +
@@ -2157,103 +3027,128 @@ exports[`single fields select field multiple choice formData 1`] = ` `; -exports[`single fields select field multiple choice with labels 1`] = ` +exports[`single fields select field single choice formData 1`] = `
- - - -   - +
+ + + + + bar + +
+ + + + + +
-
@@ -2270,106 +3165,80 @@ exports[`single fields select field multiple choice with labels 1`] = ` `; -exports[`single fields select field single choice enumDisabled 1`] = ` +exports[`single fields slider field 1`] = `
- - - - - - -
- - - - - +
+
+
+
+
+
+
+
+
+
+
+ -
-`; - -exports[`single fields string field format data-url 1`] = ` -
-
-
- -
-
- -
-`; - -exports[`single fields string field format email 1`] = ` -
-
- + className="ant-row ant-form-item-row" + style={Object {}} + > +
+
+
+ + + + +
+
+
+
+