Skip to content
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(#3233): fix rendering 0 when there are no errors. #3234

Merged
merged 7 commits into from Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -34,6 +34,9 @@ should change the heading of the (upcoming) version to include a major version b
- For JSON Schemas with `$id`s, use a pre-compiled Ajv validation function when available.
- No longer fail to validate inner schemas with `$id`s, fixing [#2821](https://github.com/rjsf-team/react-jsonschema-form/issues/2181).

## @rjsf/antd
- No longer render extra 0 for array without errors, fixing [#3233](https://github.com/rjsf-team/react-jsonschema-form/issues/3233)

suyanhanx marked this conversation as resolved.
Show resolved Hide resolved
# 5.0.0-beta.12

## @rjsf/antd
Expand Down
2 changes: 1 addition & 1 deletion packages/antd/src/templates/FieldTemplate/index.tsx
Expand Up @@ -69,7 +69,7 @@ const FieldTemplate = ({
colon={colon}
extra={rawDescription && description}
hasFeedback={schema.type !== "array" && schema.type !== "object"}
help={(!!rawHelp && help) || (rawErrors?.length && errors)}
help={(!!rawHelp && help) || (rawErrors?.length ? errors : undefined)}
suyanhanx marked this conversation as resolved.
Show resolved Hide resolved
htmlFor={id}
label={displayLabel && label}
labelCol={labelCol}
Expand Down
2 changes: 1 addition & 1 deletion packages/antd/test/__snapshots__/Array.test.tsx.snap
Expand Up @@ -745,7 +745,7 @@ exports[`array fields empty errors array 1`] = `
className="form-group field field-string"
>
<div
className="ant-form-item ant-form-item-with-help"
className="ant-form-item"
>
<div
className="ant-row ant-form-item-row"
Expand Down