diff --git a/CHANGELOG.md b/CHANGELOG.md index 7812e78bd6..89ee1e5b6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ should change the heading of the (upcoming) version to include a major version b --> # 5.12.1 +## @rjsf/antd + +- Updated CheckboxesWidget to not show duplicate title, fixing [#3815](https://github.com/rjsf-team/react-jsonschema-form/issues/3815) + ## @rjsf/utils - Updated `retrieveSchemaInternal` allOf logic for precompiled schemas to resolve top level properties fixing [#3817](https://github.com/rjsf-team/react-jsonschema-form/issues/3817) diff --git a/packages/antd/src/widgets/CheckboxesWidget/index.tsx b/packages/antd/src/widgets/CheckboxesWidget/index.tsx index 8dd296ae90..a6d8fd5a8b 100644 --- a/packages/antd/src/widgets/CheckboxesWidget/index.tsx +++ b/packages/antd/src/widgets/CheckboxesWidget/index.tsx @@ -4,9 +4,7 @@ import { ariaDescribedByIds, enumOptionsIndexForValue, enumOptionsValueForIndex, - getTemplate, optionId, - titleId, FormContextType, WidgetProps, RJSFSchema, @@ -23,25 +21,8 @@ export default function CheckboxesWidget< T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any ->({ - autofocus, - disabled, - formContext, - id, - label, - hideLabel, - onBlur, - onChange, - onFocus, - options, - readonly, - registry, - schema, - uiSchema, - value, -}: WidgetProps) { +>({ autofocus, disabled, formContext, id, onBlur, onChange, onFocus, options, readonly, value }: WidgetProps) { const { readonlyAsDisabled = true } = formContext as GenericObjectType; - const TitleFieldTemplate = getTemplate<'TitleFieldTemplate', T, S, F>('TitleFieldTemplate', registry, options); const { enumOptions, enumDisabled, inline, emptyValue } = options; @@ -65,17 +46,6 @@ export default function CheckboxesWidget< return Array.isArray(enumOptions) && enumOptions.length > 0 ? ( <> - {!hideLabel && !!label && ( -
- (id)} - title={label} - schema={schema} - uiSchema={uiSchema} - registry={registry} - /> -
- )} +
+ +
- + An enum list rendered as checkboxes
*:not(style)~*:not(style) { +.emotion-3>*:not(style)~*:not(style) { margin-top: 0.5rem; -webkit-margin-end: 0px; margin-inline-end: 0px; @@ -344,7 +349,7 @@ exports[`single fields checkboxes field 1`] = ` margin-inline-start: 0px; } -.emotion-3 { +.emotion-4 { cursor: pointer; display: -webkit-inline-box; display: -webkit-inline-flex; @@ -358,7 +363,7 @@ exports[`single fields checkboxes field 1`] = ` position: relative; } -.emotion-4 { +.emotion-5 { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -381,16 +386,16 @@ exports[`single fields checkboxes field 1`] = ` flex-shrink: 0; } -.emotion-5 { +.emotion-6 { -webkit-margin-start: 0.5rem; margin-inline-start: 0.5rem; } -.emotion-19 { +.emotion-20 { margin-top: 3px; } -.emotion-20 { +.emotion-21 { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -435,11 +440,18 @@ exports[`single fields checkboxes field 1`] = ` className="chakra-form-control emotion-1" role="group" > +