moderate-tomatoM
Refine14mo ago
4 replies
moderate-tomato

Modal form only responds to `onOkButtonClick`, but not `onFinish` in form [Antd design]

Here is the code snippet. This seems to be a really odd issue, as by nature I expect that the modal form should be able to respond to either prop mentioned in the title.
export const AddressModal = ({
    form,
    modalProps,
    formProps,
    onFinishHandler
}: {
    form: any
    modalProps: ModalProps,
    formProps: FormProps,
    onFinishHandler: (values: any) => void
}) => {

    return (
        <Modal {...modalProps} okButtonProps={{
            ...modalProps.okButtonProps,
            onClick: onFinishHandler // `onFinishHandler` has to be passed here 
        }}>
            <Form {...formProps} form={form} layout="vertical" >
Was this page helpful?