Ability to hide the submit button when the form is set to autosave #893
-
The submit button becomes redundant when autosave is enabled, it would be nice to just hide it. Also because the autosave is triggering onSubmit, you cannot have a close modal or close drawer function as part of the onSubmit. Maybe allow autosave to accept either undefined or a function. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @bmartin1134. Have you tried the function Null() {
return null;
}
function MyAutoForm(props) {
return <AutoForm submitField={props.autosave ? Null : undefined} {...props} />;
} And as for the other thing: instead of closing the modal on submit, you can add a custom "close modal" component. To make things easier, it can replace the |
Beta Was this translation helpful? Give feedback.
Hi @bmartin1134. Have you tried the
submitField
prop? You could do something like this:And as for the other thing: instead of closing the modal on submit, you can add a custom "close modal" component. To make things easier, it can replace the
SubmitField
- see the example above.