Browse Source

fix: useForm model change validate error

pull/7512/head
tangjinzhou 7 months ago
parent
commit
ffd4d8fe92
  1. 12
      components/form/useForm.ts

12
components/form/useForm.ts

@ -214,11 +214,13 @@ function useForm(
const errorList = results.filter(
(result: { errors: string | any[] }) => result && result.errors.length,
);
return Promise.reject({
values,
errorFields: errorList,
outOfDate: lastValidatePromise !== summaryPromise,
});
return errorList.length
? Promise.reject({
values,
errorFields: errorList,
outOfDate: lastValidatePromise !== summaryPromise,
})
: Promise.resolve(values);
});
// Do not throw in console

Loading…
Cancel
Save