feat(web): disable submit while saving + Save & create another + Cmd/Ctrl+Enter (#46)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -61,7 +61,7 @@ function ObjectEditFormLoaded({ object, id }: { object: AdminObjectView; id: str
|
||||
|
||||
const defaults = { core, fields: object.fields };
|
||||
|
||||
const onSubmit = async (values: ObjectFormValues) => {
|
||||
const onSubmit = async (values: ObjectFormValues): Promise<boolean> => {
|
||||
setError(null);
|
||||
setFieldErrorKey(null);
|
||||
|
||||
@@ -76,10 +76,11 @@ function ObjectEditFormLoaded({ object, id }: { object: AdminObjectView; id: str
|
||||
setError(t("form.rejected"));
|
||||
}
|
||||
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
navigate(`/objects/${id}`);
|
||||
return true;
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user