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

@rjsf/antd Text input shows error icon when extra errors is [] #2575

Closed
3 tasks done
ChocolateLoverRaj opened this issue Oct 2, 2021 · 0 comments · Fixed by #2576
Closed
3 tasks done

@rjsf/antd Text input shows error icon when extra errors is [] #2575

ChocolateLoverRaj opened this issue Oct 2, 2021 · 0 comments · Fixed by #2576
Labels

Comments

@ChocolateLoverRaj
Copy link
Contributor

Prerequisites

Description

I ran into a scenario where there are no actual form errors, and the form can be submitted, but to the user it looks like the input is invalid. It has a red border and red error icon, indicating that it is invalid, even though it is not actually invalid.

Steps to Reproduce

Here is sandbox: https://stackblitz.com/edit/react-1dcgru?file=src%2FApp.js

  1. Use @rjsf/antd
  2. Render a form component...

with an object schema with a string property. Example:

{
  type: 'object',
    properties: {
      name: {
        type: 'string',
      }
    }
}

and a extraErrors prop with an empty array of errors. Example:

{
  name: {
    __errors: [],
  },
}
  1. Look at the red text input

Expected behavior

When the errors are [], it should understand that there are no errors.

Actual behavior

The antd design input showed validation errors.
Validation error screenshot

Version

{
  "@ant-design/icons":"4.6.4",
  "@babel/runtime":"^7.15.4",
  "@rjsf/antd":"3.1.0",
  "@rjsf/core":"3.1.0",
  "antd":"4.16.13",
  "antd-dayjs-webpack-plugin":"1.0.0",
  "classnames":"^2.3.1",
  "dayjs":"1.10.7",
  "lodash":"4.17.21",
  "rc-picker":"^2.5.18",
  "react":"17.0.2",
  "react-dom":"17.0.2"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants