React-jsonschema-form: Disable form clear?

Created on 19 May 2017  路  2Comments  路  Source: rjsf-team/react-jsonschema-form

Prerequisites

  • [X] I have read the documentation;
  • [X] In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.

Description

When I submit my form, all of the fields are cleared and you cannot resubmit the same form with the same data. Is there a way to disable this feature or maintain the current values after form submission?

Most helpful comment

Im currently working on a form with the same default behavior and would like to know how to prevent this from happening as well.

All 2 comments

Im currently working on a form with the same default behavior and would like to know how to prevent this from happening as well.

Figured it out. This is mentioned in #391 where the original values are reset in the form. You have to pass persistent formData into the form as mentioned in @n1k0 fiddle: https://jsfiddle.net/954uLrrL/2/. This solved the issue for me.

Was this page helpful?
0 / 5 - 0 ratings