diff --git a/CHANGELOG.md b/CHANGELOG.md index c388da37a3..2107c87b68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,51 @@ it according to semantic versioning. For example, if your PR adds a breaking cha should change the heading of the (upcoming) version to include a major version bump. --> +# 6.0.2 + +## @rjsf/shadcn + +- Updated `FieldTemplate` to skip label and description rendering for checkbox widgets, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742)) + +## @rjsf/semantic-ui + +- Updated `FieldTemplate` to skip label and description rendering for checkbox widgets, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742)) + +## @rjsf/react-bootstrap + +- Updated `FieldTemplate` to skip label and description rendering for checkbox widgets, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742)) + +## @rjsf/primereact + +- Updated `FieldTemplate` to skip label and description rendering for checkbox widgets, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742)) + +## @rjsf/mui + +- Updated `FieldTemplate` to skip label and description rendering for checkbox widgets, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742)) + +## @rjsf/mantine + +- Updated `CheckboxWidget` to handle label and description rendering consistently, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742)) + +## @rjsf/fluentui-rc + +- Updated `FieldTemplate` to skip label and description rendering for checkbox widgets, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742)) + +## @rjsf/antd + +- Updated `FieldTemplate` to skip label and description rendering for checkbox widgets, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742)) + + +## @rjsf/chakra-ui + +- Updated `CheckboxWidget` to handle label and description rendering consistently, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742)) + +## @rjsf/core + +- Fixed duplicate label and description rendering in `CheckboxWidget` by conditionally rendering them based on widget type + - Updated `CheckboxWidget` to handle label and description rendering consistently + - Modified `FieldTemplate` to skip label and description rendering for checkbox widgets, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742)) + # 6.0.1 ## Dev / docs / playground diff --git a/packages/antd/src/templates/FieldTemplate/index.tsx b/packages/antd/src/templates/FieldTemplate/index.tsx index 65ccf87a8c..9b32dcdaa0 100644 --- a/packages/antd/src/templates/FieldTemplate/index.tsx +++ b/packages/antd/src/templates/FieldTemplate/index.tsx @@ -56,6 +56,7 @@ export default function FieldTemplate< } = formContext as GenericObjectType; const uiOptions = getUiOptions(uiSchema); + const WrapIfAdditionalTemplate = getTemplate<'WrapIfAdditionalTemplate', T, S, F>( 'WrapIfAdditionalTemplate', registry, @@ -79,7 +80,7 @@ export default function FieldTemplate< descriptionProps.extra = descriptionNode; break; } - + const isCheckbox = uiOptions.widget === 'checkbox'; return ( `; +exports[`single fields checkbox field with description in schema and FieldTemplate 1`] = ` +
+
+
+
+
+
+
+ +
+
+
+
+ + This is a checkbox description + +
+
+
+
+
+
+ +
+`; + exports[`single fields checkbox field with label 1`] = `
`; +exports[`single fields radio widget with description in schema and FieldTemplate 1`] = ` + +
+
+
+
+ +
+
+
+
+
+ + +
+
+
+
+
+ + This is a radio description + +
+
+
+
+
+
+ +
+`; + exports[`single fields schema examples 1`] = `
`; +exports[`single fields select widget with description in schema and FieldTemplate 1`] = ` + +
+
+
+
+ +
+
+
+
+
+
+ + + + + + +
+ + + + + +
+
+
+
+
+ + This is a select description + +
+
+
+
+
+
+ +
+`; + exports[`single fields slider field 1`] = `
onChange(checked); const _onBlur = ({ target }: FocusEvent) => onBlur(id, target && target.checked); diff --git a/packages/chakra-ui/test/__snapshots__/Form.test.tsx.snap b/packages/chakra-ui/test/__snapshots__/Form.test.tsx.snap index 29a0711d2e..66e2062e5f 100644 --- a/packages/chakra-ui/test/__snapshots__/Form.test.tsx.snap +++ b/packages/chakra-ui/test/__snapshots__/Form.test.tsx.snap @@ -544,7 +544,7 @@ exports[`nameGenerator bracketNameGenerator array of objects 1`] = ` className="rjsf-field rjsf-field-object" >
@@ -685,7 +685,7 @@ exports[`nameGenerator bracketNameGenerator array of objects 1`] = ` className="rjsf-field rjsf-field-boolean" >