Modal Form submit was not triggered.
can-acar opened this issue · comments
Can Acar commented
I did as in the example, it doesn't work.
const RenderFooter = (({handleClick}) => {
return (
<div>
<Modal.Submit>Kaydet</Button>
<Button onClick={handleClick}>İptal</Button>
</div>
)
});
However, it worked when I did it by the method below:
const RenderFooter = (({handleClick, handleSubmit}) => {
return (
<div>
<Button onClick={handleSubmit}>Kaydet</Button>
<Button onClick={handleClick}>İptal</Button>
</div>
)
});
.....
let formRef = useRef();
....
return <Modal
visible={state.visible}
width={456}
title={formData.adi + " " + formData.soyadi + " bilgilerini düzenle"}
onClose={handleClose}
footer={<RenderFooter handleClick={handleClose} handleSubmit={() => {
if (formRef.current.props)
formRef.current?.props.onSubmit(formData)
}}/>}>
<Form
ref={formRef}
labelWidth={100}
rules={rules}
value={formData}
labelAlign="right"
style={{maxWidth: 400}}
onChange={onChangeForm}
onSubmit={handleSubmit}>
....
version:1.6.1
Eastblue commented
@51tharea Hi buddy, are you using React17 for your project?
React17 should have made a change to the event system that caused the dispatchEvent to fail to respond successfully.
We will use native events to fix this issue.
Thank you for your feedback.
Eastblue commented
They did make a change to the non-bubbling event for submit in React17 that caused the original manual commit in the modal to fail, which we've fixed in the @next version.🤝