final-form / final-form/react-final-form

parseBeforeSubmit on Field level

Open
#136 4 comments 6 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

**feature request**

Would it be possible to have a `parseBeforeSubmit` prop on the `Field`?
It should behave similar to `parse` but only runs before the form submit and can also handle async stuff. Maybe every field's `parseBeforeSubmit` would run in parallel before resolving to the final form onSubmit.

This would ensure a better decoupling between different types of input components and its parent form. At the moment the Form always has to know and handle some kind of special input components separately. For example if the Form includes a "Rich Text Editor Field" it can not parse & serialize its value on every keystroke, so we have to do it inside the forms `onSubmit` function. Another example would be a component which handles image uploads and transformations before submitting the page.

Let me know what you think, thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.