rjsf-team / react-jsonschema-form

A React component for building Web forms from JSON Schema.
https://rjsf-team.github.io/react-jsonschema-form/
Apache License 2.0
14.38k stars 2.2k forks source link

Form not clearing errors after fixing them #4296

Open igorbrasileiro opened 2 months ago

igorbrasileiro commented 2 months ago

Prerequisites

What theme are you using?

core

Version

5.20.1

Current Behavior

The issue: https://www.loom.com/share/795d1901570a4f8db4030be13e4b4782 After fixing an error in an object inside an array, the errors are not cleared and propagated to other fields.

Expected Behavior

After fixing the error in the form, clean the errors

Steps To Reproduce

  1. Go to rjsf playground
  2. get the schema from this json:
    await fetch('https://htmx.store/live/_meta').then(res => res.json()).then(meta => {
    const schema = meta.schema
    schema.$ref = meta.manifest.blocks.pages['website/pages/Page.tsx'].$ref
    return schema;
    })
  3. get the formData from this json:
    await fetch('https://htmx.store/.decofile').then(res => res.json()).then(blocks => blocks['pages-home-c4bcbfb771e9'])
  4. enable form live validation
  5. go to section-2 > banner > alt required property
  6. clean the field. Will show an error here
  7. type something, to fix the error. The error will be maintained on section-2

Environment

- OS:
- Node:
- npm:

Anything else?

No response

igorbrasileiro commented 2 months ago

How can I share the RJSF playground? I'm clicking on the share button but nothing happens.

heath-freenome commented 2 months ago

How can I share the RJSF playground? I'm clicking on the share button but nothing happens.

@igorbrasileiro after clicking share, the button changes into something that looks like this... Just click the icon that symbolized copy to clipboard and you'll have your link

Screenshot 2024-09-13 at 12 22 46 PM

Once you do that, then can you update the description above with the link?

igorbrasileiro commented 2 months ago

@heath-freenome I tried again now, but after editing the schema and then clicking on the share button I got this error: image image

abdalla-rko commented 3 weeks ago

Hi @igorbrasileiro, I just did pr to fix the issue with playground share not working with large content. I tried to reproduce your demo. I can't reproduce the issue where errors persist after removing the alt field content and adding the content back, all errors go away now. This might be fixed with recent bug fixes. Let me know if you still can reproduce the issue where errors persist.

abdalla-rko commented 3 weeks ago

rjsf-playground-link.txt Attached a file with the rjsf playground link content in it since github comments have a maximum of 65k characters and the link is much longer.