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

autosave triggers onSubmit as soon as the form is mounted #204

Closed
macrozone opened this issue Feb 24, 2017 · 3 comments
Closed

autosave triggers onSubmit as soon as the form is mounted #204

macrozone opened this issue Feb 24, 2017 · 3 comments
Assignees
Labels
Type: Bug Bug reports and their fixes

Comments

@macrozone
Copy link
Contributor

I have something like this:

  <AutoForm
        onSubmit={(newProfile) => updateUserProfile(userId, newProfile))
        model={userProfile}
        schema={userProfileSchema.pick('imageUrl')}
        autosave
      />

updateUserProfile is called here as soon as the form is mounted. Am i missing something?

@radekmie radekmie self-assigned this Feb 24, 2017
@radekmie radekmie added the Type: Bug Bug reports and their fixes label Feb 24, 2017
@radekmie
Copy link
Contributor

I'll try to investigate it.

@radekmie
Copy link
Contributor

OK, I've found it. The problem is here. It is because AutoForm render an AutoField which render XField (depending on type), but AutoField passes down all of its props, so it is used as an initial value. I'll try to come with a better solution (and a bugfix of course).

@macrozone
Copy link
Contributor Author

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug reports and their fixes
Projects
Archived in project
Development

No branches or pull requests

2 participants