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

reset sets model back to initial model #145

Merged
merged 2 commits into from
Dec 18, 2016

Conversation

macrozone
Copy link
Contributor

fixes #140

however, something is odd:

In the demo, the form already contains default-values. not from the mode, but from the bridge/schema.

reset does not seem to restore these default-values and i am unsure whether this should be the case.

@radekmie
Copy link
Contributor

radekmie commented Dec 5, 2016

Let me guess - you haven't noticed this?

@radekmie
Copy link
Contributor

radekmie commented Dec 6, 2016

Also, which form in the docs? The main one and the one on the left are managed.

@radekmie
Copy link
Contributor

radekmie commented Dec 7, 2016

@macrozone

@macrozone
Copy link
Contributor Author

@radekmie: the one on the right and yes, I haven't noticed that, but that cleans the schema for the form on the right.

The form on the right does not restore defaults, when you call reset, but it initially contains the default values. I would think that a reset should also restore defaults from the schema.

@radekmie
Copy link
Contributor

radekmie commented Dec 9, 2016

@macrozone OK, now I understand. Look at these lines. At first, we call BaseForm#reset, which will rerender the whole form, including calculation of default values. To fix it, we have to switch those lines in AutoForm or even call super.onSubmit() in the setState callback.

@radekmie
Copy link
Contributor

@macrozone Will you test it, or should I do it by myself?

@radekmie radekmie added the Type: Feature New features and feature requests label Dec 12, 2016
@radekmie radekmie merged commit c8cb275 into vazco:master Dec 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New features and feature requests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

reset should set initial model
2 participants