submit later when validating

This commit is contained in:
codetypes committed 2025-04-13 22:24:03 +08:00
1 parent 3b034d27d3
commit b2acee3b6e
1 file changed
+8 -2
+8 -2
View File
@@ -580,6 +580,12 @@ const NodeInspector: FC = () => {
); );
const submit = () => { const submit = () => {
if (form.isFieldsValidating()) {
setTimeout(() => {
submit();
}, 10);
return;
}
if (form.getFieldsError().some((e) => e.errors.length > 0)) { if (form.getFieldsError().some((e) => e.errors.length > 0)) {
const data = workspace.editingNode.data; const data = workspace.editingNode.data;
const editor = workspace.editing!; const editor = workspace.editing!;
@@ -827,7 +833,7 @@ const NodeInspector: FC = () => {
}); });
finish(form.getFieldsValue()); finish(form.getFieldsValue());
} else { } else {
form.submit(); submit();
} }
}; };
@@ -835,7 +841,7 @@ const NodeInspector: FC = () => {
if (form.getFieldValue("path") !== editingNode.data.path) { if (form.getFieldValue("path") !== editingNode.data.path) {
finish(form.getFieldsValue()); finish(form.getFieldsValue());
} else { } else {
form.submit(); submit();
} }
}; };