Skip to content

Commit

Permalink
fix(#3233): fix rendering 0 when there are no errors. (#3234)
Browse files Browse the repository at this point in the history
* fix(#3233): fix rendering 0 when there are no errors.

* fix: update snapshot and changelog

* fix: update snapshot

Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
  • Loading branch information
suyanhanx and heath-freenome committed Dec 8, 2022
1 parent 00062d5 commit c0c0142
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
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)

# 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)}
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

0 comments on commit c0c0142

Please sign in to comment.