Skip to content

Commit 7bf4b30

Browse files
committed
fix(form): fix DrawerForm and ModalForm button error
1 parent 644967d commit 7bf4b30

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/form/src/layouts/DrawerForm/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import React, {
2121
import { createPortal } from 'react-dom';
2222
import type { CommonFormProps, ProFormInstance } from '../../BaseForm';
2323
import { BaseForm } from '../../BaseForm';
24+
import { SubmitterProps } from '../../components/Submitter';
2425
import { useStyle } from './style';
2526

2627
export type CustomizeResizeType = {
@@ -227,7 +228,10 @@ function DrawerForm<T = Record<string, any>, U = Record<string, any>>({
227228
drawerProps?.onClose?.(e);
228229
},
229230
},
230-
},
231+
render: (_, dom) => {
232+
return [...dom].reverse();
233+
},
234+
} as SubmitterProps,
231235
rest.submitter,
232236
);
233237
}, [

packages/form/src/layouts/ModalForm/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import React, {
1616
import { createPortal } from 'react-dom';
1717
import type { CommonFormProps, ProFormInstance } from '../../BaseForm';
1818
import { BaseForm } from '../../BaseForm';
19+
import { SubmitterProps } from '../../components/Submitter';
1920

2021
export type ModalFormProps<
2122
T = Record<string, any>,
@@ -177,7 +178,10 @@ function ModalForm<T = Record<string, any>, U = Record<string, any>>({
177178
modalProps?.onCancel?.(e);
178179
},
179180
},
180-
},
181+
render: (_, dom) => {
182+
return [...dom].reverse();
183+
},
184+
} as SubmitterProps,
181185
rest.submitter,
182186
);
183187
}, [

0 commit comments

Comments
 (0)