warnWhenUnsavedChanges is getting asked twice
I have to click "Cancel" or "Okay" twice when warnWhenUnsavedChanges is being active on my Modal form via the useModalForm hook
3 Replies
Hi @script4559. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. The extracts provided do not contain information about the
warnWhenUnsavedChanges
prop being asked twice.
However, the warnWhenUnsavedChanges
prop is used to show a warning when the user tries to leave the page with unsaved changes. It is false
by default and can be set to true
to enable this feature. This is done to prevent the user from accidentally leaving the page.
Here is how you can use it in your useModalForm
hook:
For more information, you can refer to the Refine documentation (https://refine.dev/docs).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@584066183989428345> kapa.ai is still learning and improving, please let us know how it did by reacting below
xenial-blackOP•13mo ago
help admin.
this is how I open the modal
and this is my onCancel function: