canon-react icon indicating copy to clipboard operation
canon-react copied to clipboard

Decoupling "processing" from enabling/disabling the submit button on FormPopover

Open MACSkeptic opened this issue 8 years ago • 1 comments

While using FormPopover I noticed that there is only one flag that controls if the submit button is enabled or not, and that is the processing prop.

The problem is, that prop also controls the cancel and the processing indicator.

There are cases where we'd want the submit button to be disabled, but the cancel button to still be there (and not processing indicator). An example: a form is pristine, we don't want the user to submit the popover if she hasn't made any change to the values that were already there.

I believe is this currently not possible without some ugly hacks by double wrapping the custom footer components.

My suggestion is to add an extra flag disableSubmit or canSubmit or readyToSubmit... something along those lines. It could default to allow submit and would take hard precedence over processing when it comes to controlling the submit button.

Thoughts?

MACSkeptic avatar Nov 10 '16 14:11 MACSkeptic