-
Couldn't load subscription status.
- Fork 75
Open
Description
The Form component support throwing error in its onSubmit callback and renders the error message. But I my application, the FormAction is not reset to enabled even if I modify the input.
Full example: https://codesandbox.io/s/trusting-brown-42suu
Root cause:
| return <BaseFormActions {...props} disabled={!valid} processing={submitting} />; |
A possible solution:
export default function FormActions(props: FormActionsProps) {
const form = useForm();
// this line changed
const { submitting, valid, dirtySinceLastSubmit } = form.getState();
return (
<BaseFormActions
{...props}
// this line changed
disabled={!dirtySinceLastSubmit && !valid}
processing={submitting}
/>
);
}Metadata
Metadata
Assignees
Labels
No labels