Closed ghost closed 11 months ago
Can you add more details of the code you have written so that it can be reproduced ?
Can you add more details of the code you have written so that it can be reproduced ?
Sure! Thank you!
Page with carriers and drawer toggling:
CreateCarrierForm component:
Drawer is quite simple. It contains {children} and toggling by isOpened boolean value. If I separate form from the Drawer - everything working as expected. It looks like submit button inside the drawer calls nothing. Changing { Form } from Formik to plain form onSubmit='...' has no result too, same as dealing with Formik prop on Submit.
console.log
displayed ?<Formik
initialValues={initialValues}}
validationSchema={createCarrierSchema}
onSubmit={(values, actions) => {
actions.setSubmitting(false);
}}
>
....
</Formik>
- Is
console.log
displayed ?- Can you try
<Formik initialValues={initialValues}} validationSchema={createCarrierSchema} onSubmit={(values, actions) => { actions.setSubmitting(false); }} > .... </Formik>
That's the point. This part doesn't work because if I click on 'submit' btn the whole page reloads.
@juvpengele I found the solution. Thank you for your response.
In case anyone needed:
Bug report
Current Behavior
Submit btn reloads page if Formik is inside callable component like aside drawer. Any variations of prevent default doesn't solve this problem. If I click on submit btn, page reloads, validation doesn't work and it looks like GET request, because I see query in url.
Suggested solution(s)
How could I solve this?
Your environment