Skip to content

Commit

Permalink
feat: 修复 form submit 报错 (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
honkinglin authored Mar 18, 2022
1 parent a499fa1 commit 0b97c07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/form/hooks/useInstance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ export default function useInstance(props: TdFormProps, formRef, formItemsRef) {
}

// 对外方法 手动提交表单
function submit(e: React.FormEvent<HTMLFormElement>) {
function submit(e?: React.FormEvent<HTMLFormElement>) {
if (preventSubmitDefault) {
e.preventDefault?.();
e.stopPropagation?.();
e?.preventDefault?.();
e?.stopPropagation?.();
}
validate().then((r) => {
const firstError = getFirstError(r);
Expand Down

0 comments on commit 0b97c07

Please sign in to comment.