Skip to content
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

Option to clear SQFormDialog after submit #815

Open
samasastudio opened this issue Nov 11, 2022 · 1 comment
Open

Option to clear SQFormDialog after submit #815

samasastudio opened this issue Nov 11, 2022 · 1 comment

Comments

@samasastudio
Copy link
Contributor

When cancelling changes for a "dirty" SQFormDialog form, we clear out the form so the user can start with fresh inputs with their next attempt. This same clear isn't run when the primary/submit/save button is selected and the dialog is closed out. For our work on SRTS 2, we would like the option to run this clear when following the primary button user flow.

This could take the form of a prop flag that by default would be false, but if set to true would clear the form after the primary button is selected.

Here is a loom unpacking the issue: https://www.loom.com/share/7644c1f7bbcb4ba88d1aa12c122fa6e8

@samasastudio
Copy link
Contributor Author

Instead of capturing this behavior in the component, @20BBrown14 has suggested utilizing the formikBag interface that's exposed when running the onSave or onSubmit callback to control clearing the form and any other desired behavior that happens alongside the primary button selection.

This prop is just an exposure of this Formik functionality: https://formik.org/docs/api/formik#resetform-nextstate-partialformikstatevalues--void

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant