jaredpalmer / formik

Build forms in React, without the tears 😭
https://formik.org
Apache License 2.0
33.91k stars 2.79k forks source link

Add onsubmit event on onSubmit hook #3829

Open LarsFlieger opened 1 year ago

LarsFlieger commented 1 year ago

Feature request

Current Behavior

The onSubmit provides onSubmit: (values: Values, formikBag: FormikBag) => void | Promise<any>

Desired Behavior

Can we get the original button event as a third parameter. This is super useful when dealing with multiple submit buttons or other stuff.

Suggested Solution

onSubmit: (values: Values, formikBag: FormikBag, event: React.FormEvent<HTMLFormElement>) => void | Promise<any>

Who does this impact? Who is this for?

A few people require doing this: