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

Pass submission result to redux-form submit handler #34

Closed
wants to merge 1 commit into from
Closed

Pass submission result to redux-form submit handler #34

wants to merge 1 commit into from

Conversation

maxmalov
Copy link

Redux form can handle submission results returned by onSubmit handler, for example, https://redux-form.com/7.2.3/docs/api/reduxform.md/#-code-onsubmitsuccess-function-code-optional-

These changes propose passing a submission results to onSubmit handler

@afitiskin
Copy link
Owner

Finally, they fixed this! :) It was a workaround for redux-form version 6.

@afitiskin
Copy link
Owner

I will check this soon and if everything is ok I will merge your PR

@afitiskin
Copy link
Owner

afitiskin commented Mar 6, 2018

Sorry, the problem with async validation is still exists in redux-form, so I can't merge this PR.
More info about the problem:

  1. You need to have async validation in your form.
  2. Async validation function should return promise (like routine does)
  3. Async validation function should resolve promise with some data
  4. Async validation will pass but submission of the form will be impossible

Resolving promise with some data is blocking form submission forever so using routines for async validation is impossible.

How to reproduce:

  1. Clone https://github.com/afitiskin/redux-form
  2. Checkout broken-async-validation-example
  3. Go to redux-form/examples/brokenAsyncValidation
  4. Make npm install && npm start
  5. Fill the form and try to submit
  6. You will see no effect, there is (index):1 Uncaught (in promise) You shall not pass! in console.

There is a bug report to redux-form, but it has been closed due to inactivity...

@afitiskin
Copy link
Owner

I submitted new bug report to redux-form: redux-form/redux-form#3895

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants