-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add possibility to change function passed to handleSubmit #4684
Add possibility to change function passed to handleSubmit #4684
Conversation
…ing form remotely
Hi @iamandrewluca, can we do something with it? |
We don't want to add any legacy things, this will make development of library even harder if we want to move on with next versions of react.
|
@iamandrewluca I've changed unsafe methods of this component |
Thankss @ideffix, I'll find some time to make a new release. |
Hi @iamandrewluca, I know its been a while since this PR was merged to master, but can we have a realease version with it? I kinda need it now :D |
Published in |
@ideffix FYI |
Gr8, thanks guys! 🥇 |
Closes #4682
When submiting form remotely by dispatching
submit
action and duringForm
lifetime and method provided to handleSubmit has changed - it isn't fired - only first function provided toForm
is fired. After invastigation I've noticed that for remote submittingsubmit
function fromcreateReduxForm.js
calls methodinnerOnSubmit()
and it is set with following function:registerInnerOnSubmit: innerOnSubmit => (this.innerOnSubmit = innerOnSubmit)
.In
Form.js
I can see that it only register method when component will mountthis.props._reduxForm.registerInnerOnSubmit(this.props.onSubmit)
so even if you change method provided to handleSubmit duringForm
life, it wont be firedonSubmit
.My fix adds possibility to change that method during
Form
life.