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

ArrayFieldItemTemplate errors are not getting resetting on remove and new addition #4435

Open
4 tasks done
DharamveerYadav opened this issue Jan 1, 2025 · 1 comment
Open
4 tasks done

Comments

@DharamveerYadav
Copy link

DharamveerYadav commented Jan 1, 2025

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

Currently error messages are not getting reset for ArrayFieldItemTemplate, If I have done validation and do removal and new addition.

Expected Behavior

Error messages should reset.

Steps To Reproduce

  1. go to this playground
{
  "definitions": {
    "Thing": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "default": "Default name"
        }
      }
    }
  },
  "type": "object",
  "properties": {
    "listOfStrings": {
      "type": "array",
      "title": "A list of strings",
      "items": {
        "type": "string"
      }
    }
  }
}
  1. add new row and click on validate
image
  1. now remove the last array item.
image
  1. Add new item again.
image

Ideally error message should not come again, if this is a new row. Basically schema is containing errors and not resetting remove and add operation.

Environment

- OS:
- Node:
- npm:

Anything else?

https://rjsf-team.github.io/react-jsonschema-form/

@DharamveerYadav DharamveerYadav added bug needs triage Initial label given, to be assigned correct labels and assigned labels Jan 1, 2025
@heath-freenome
Copy link
Member

@DharamveerYadav If you turn on live validate (as provided in this playground), you'll see the validation errors going away using your steps. This is not a bug since validation is an active behavior that must be done on the form.

@heath-freenome heath-freenome added question awaiting response and removed bug needs triage Initial label given, to be assigned correct labels and assigned labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants