Open Maxim1saev opened 3 years ago
I believe you need to explicitly set the form's onSubmit to the FinalFormRenderProps handleSubmit value. Notice how the example from the react-final-form docs sets the form
element's onSubmit from the render props:
<Form onSubmit={onSubmit}>
{props => (
<form onSubmit={props.handleSubmit}>
... fields go here...
<button type="submit">Submit</button>
</form>
)}
</Form>
Once that value is set the form should submit properly. You'll also want to make sure that the button element you're using to trigger the form has a type of "submit".
@tjb042 it is your version that does not work
I made a sandbox with an example, and it seems to work fine. @Maxim1905 can you provide a minimal reproducible sandbox or repo with the error you are facing? It's hard to say what might be wrong without seeing more code.
Looks like your button is in the footer portion of a modal. That means it may not be nested so it may need to follow external submit pattern or make use of FormSpy. It would be better to give a complete example than screenshots as you're leaving a lot to the imagination.
Hello! We use "final-form": "4.20.2", the submission stopped working when it was passed to the rff component you have to explicitly transfer the handler to onclick
Previously, everything worked correctly
Thanks in advance!)