rescriptbr / reform

📋 Reasonably making forms sound good
https://rescript-reform.netlify.app/
MIT License
354 stars 41 forks source link

"Submitting" form state is replaced with "Valid" straight away #236

Open alexeygolev opened 2 years ago

alexeygolev commented 2 years ago

I've just noticed that #218 introduced a line that sends a SetFormState(Valid) action immediately after sending the Submit action. Not sure what the purpose of the change is but it results in no Submitting state. I noticed it because I disable the submit button on submit and it's no longer being disabled. If I log formState on render it stays Valid up until the form is successfully submitted. Is this intentional? https://github.com/rescriptbr/reform/blob/6c8d6de710896a5f35daf91ab5ea6d7b3801f9f4/reform/src/ReForm.res#L253

vmarcosp commented 2 years ago

Hey @alexeygolev thanks for reporting. It's not intentional and i'ts probably a bug. I'll test the behavior and ping you with a better explanation for this issue. cc @fakenickels

vmarcosp commented 2 years ago

And sorry for the delay, it has been a busy month.

fakenickels commented 2 years ago

Hey thanks for bringing this up. It definitively sounds like a bug

fakenickels commented 2 years ago

It should put the form in Valid state then Submitting. I took a quick look in the code and not sure what can be causing it to not be working normally