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

[Antd] [FieldTemplate] The form item displayed error style, but has been validated correct by ajv.js on submit. #2483

Closed
3 tasks done
zzwfe opened this issue Jul 24, 2021 · 2 comments
Labels
antd antd related theme issue bug

Comments

@zzwfe
Copy link

zzwfe commented Jul 24, 2021

Prerequisites

Description

I used the antd's theme of the react-jsonschema-form. when i validated part of my form and submit, the form item's error tips was not showed, but the style was still here.

Steps to Reproduce

  1. I have created a minimal project in codesanbox.
  2. Click the Submit button at first, and then the errors tips show with the error style. It's expected.
    image
  3. Select the name form item, for example, i chose a one as my answer. in rapid sequence, click the Submit again, the error tips of the name form item is disappeared, but the error style is still here.
    image

Expected behavior

  1. I think we should make a change for the code
    origin code
...
validateStatus={rawErrors ? 'error' : undefined}
...

coming code

...
validateStatus={rawErrors?.length ? 'error' : undefined}
...

2.pleace do the 1st step, and then, the the form item of the name is validated successfully, the error style is not show here together with the error tips again. just like that:
image

Actual behavior

the error style of the name is still show here.

Version

@rjsf/[email protected]

@newt10 newt10 added bug antd antd related theme issue labels Sep 6, 2021
@newt10
Copy link
Collaborator

newt10 commented Sep 6, 2021

@zzwfe can you submit a PR with a change you are proposing, along with tests to ensure that we can fix this bug?

@heath-freenome
Copy link
Member

Fixed by #2576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
antd antd related theme issue bug
Projects
None yet
Development

No branches or pull requests

3 participants