You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When `true`, form will be reset when modal closes. Defaults to `true`.
669
+
670
+
```tsx
671
+
const modalForm =useModalForm({
672
+
modalProps: {
673
+
autoResetFormWhenClose: false,
674
+
},
675
+
});
676
+
```
677
+
666
678
### warnWhenUnsavedChanges
667
679
668
680
When you have unsaved changes and try to leave the current page, Refine shows a confirmation modal box. To activate this feature. By default, this feature is disabled.
`autoResetFormWhenClose` will reset the form when modal closes. It is `true` by default.
481
+
482
+
```tsx
483
+
const modalForm =useModalForm({
484
+
autoResetFormWhenClose: false,
485
+
});
486
+
```
487
+
478
488
### warnWhenUnsavedChanges
479
489
480
490
When set to true, `warnWhenUnsavedChanges` shows a warning when the user tries to leave the page with unsaved changes. It is used to prevent the user from accidentally leaving the page. It is `false` by default
Copy file name to clipboardExpand all lines: packages/antd/src/hooks/form/useModalForm/useModalForm.ts
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,7 @@ export type UseModalFormProps<
89
89
defaultVisible?: boolean;
90
90
autoSubmitClose?: boolean;
91
91
autoResetForm?: boolean;
92
+
autoResetFormWhenClose?: boolean;
92
93
};
93
94
/**
94
95
* `useModalForm` hook allows you to manage a form within a modal. It returns Ant Design {@link https://ant.design/components/form/ Form} and {@link https://ant.design/components/modal/ Modal} components props.
0 commit comments