Skip to content

Commit 6910c5c

Browse files
committed
Updated antd HelpField to consistently use Markdown for help text & restored text-danger logic in Bootstrap FieldHelpTemplate & updated core test to expect div.help-block instead of p.help-block
1 parent 6251cd5 commit 6910c5c

File tree

15 files changed

+562
-7305
lines changed

15 files changed

+562
-7305
lines changed

CHANGELOG.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ should change the heading of the (upcoming) version to include a major version b
8787
- Fixed duplicate label and description rendering in `CheckboxWidget` by conditionally rendering them based on widget type
8888
- Updated `CheckboxWidget` to handle label and description rendering consistently
8989
- Modified `FieldTemplate` to skip label and description rendering for checkbox widgets, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742))
90-
- Updated `CheckboxWidget` to handle label and description rendering consistently
91-
- Modified `FieldTemplate` to skip label and description rendering for checkbox widgets, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742))
9290
- Updated `ObjectField` to change the removal of an additional property to defer the work to the `processPendingChange()` handler in `Form`, fixing [#4850](https://github.com/rjsf-team/react-jsonschema-form/issues/4850)
9391
- Updated `FallbackField` to support `object` and `array` types, and improved `ArrayField` so that it handles missing items properly with the fallback field
9492

@@ -105,7 +103,6 @@ should change the heading of the (upcoming) version to include a major version b
105103
- Updated `FieldTemplate` to skip label and description rendering for checkbox widgets, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742))
106104
- Updated `ArrayFieldItemTemplate` to switch `size` from 'auto' to responsive values on the `Grid`, fixing [#4838](https://github.com/rjsf-team/react-jsonschema-form/issues/4838)
107105

108-
109106
## @rjsf/primereact
110107

111108
- Updated `FieldTemplate` to skip label and description rendering for checkbox widgets, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742))
@@ -126,7 +123,6 @@ should change the heading of the (upcoming) version to include a major version b
126123
## @rjsf/utils
127124

128125
- Updated `getDefaultFormState()` to not save an undefined field value into an object when the type is `null` and `excludeObjectChildren` is provided, fixing [#4821](https://github.com/rjsf-team/react-jsonschema-form/issues/4821)
129-
- Added new `ADDITIONAL_PROPERTY_KEY_REMOVE` constant
130126

131127
## Dev / docs / playground
132128

packages/antd/src/templates/FieldHelpTemplate/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,9 @@ export default function FieldHelpTemplate<
1515
return null;
1616
}
1717

18-
const id = helpId(fieldPathId);
19-
2018
return (
21-
<div id={id} className='ant-form-item-extra'>
22-
<div className='help-block'>
23-
{typeof help === 'string' ? help : <RichHelp help={help} registry={registry} uiSchema={uiSchema} />}
24-
</div>
19+
<div id={helpId(fieldPathId)} className='help-block'>
20+
<RichHelp help={help} registry={registry} uiSchema={uiSchema} />
2521
</div>
2622
);
2723
}

packages/antd/src/templates/FieldTemplate/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default function FieldTemplate<
3131
displayLabel,
3232
errors,
3333
help,
34+
rawHelp,
3435
hidden,
3536
id,
3637
label,
@@ -99,7 +100,7 @@ export default function FieldTemplate<
99100
<Form.Item
100101
colon={colon}
101102
hasFeedback={schema.type !== 'array' && schema.type !== 'object'}
102-
help={help || (rawErrors?.length ? errors : undefined)}
103+
help={(!!rawHelp && help) || (rawErrors?.length ? errors : undefined)}
103104
htmlFor={id}
104105
label={displayLabel && !isCheckbox && label}
105106
labelCol={labelCol}

packages/antd/src/templates/HelpField/index.tsx

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)