Modal form unsaved changes prompt settings
I'm using Ant Design, and I'm trying to set up a form that will be displayed within a Modal.
I'm using useModalForm and everything works great, except for one thing.
When I make any change and then try to close the form without saving, it shows the unsaved changes warning.
However, when I then click cancel on the warning prompt, it then closes the form and Modal and goes back to the parent "list" page. And if I click OK instead (which should close the form), it keeps the form open and reverts my changes.
I'm using this code-snippet from one of the examples (finefoods-antd):
I'm then using it in the Modal props for onCancel. I've tried using it as onClose instead, but then the modal just stays open.
I assume that somehow this setting is passed to the unsaved-changes prompt, which then applies that when I hit cancel, instead of keeping the form open with the changes intact.
Am I doing something wrong, or is this an expected behavior?
Note that in the finefoods-antD example, the behavior is similar and does not persist changes.
I'm using useModalForm and everything works great, except for one thing.
When I make any change and then try to close the form without saving, it shows the unsaved changes warning.
However, when I then click cancel on the warning prompt, it then closes the form and Modal and goes back to the parent "list" page. And if I click OK instead (which should close the form), it keeps the form open and reverts my changes.
I'm using this code-snippet from one of the examples (finefoods-antd):
I'm then using it in the Modal props for onCancel. I've tried using it as onClose instead, but then the modal just stays open.
I assume that somehow this setting is passed to the unsaved-changes prompt, which then applies that when I hit cancel, instead of keeping the form open with the changes intact.
Am I doing something wrong, or is this an expected behavior?
Note that in the finefoods-antD example, the behavior is similar and does not persist changes.
