vicious-gold
vicious-goldβ€’16mo ago

Antd useDrawerForm not clearing

What is the best way to clear the useDrawerForm when drawer is closed or when form is submitted? Right now even after form is submitted successfully the inputs stay the same.
5 Replies
refine-support-bot
refine-support-botβ€’16mo ago
Hi, I am refine support bot :wave:. I am here to help you with your question. I searched for the answer to your question in the refine documentation and found an answer! πŸ†
Answer: The best way to clear the useDrawerForm when drawer is closed or when form is submitted is to set the autoResetForm prop to true. SOURCES: ./docs/api-reference/antd/hooks/form/useDrawerForm.md

Note: If this is the answer you need, then we are very lucky. If not, please wait for someone from the refine core team or the community to try to help you.
vicious-gold
vicious-goldβ€’16mo ago
when I checked autoResetForm only works for useModalForm
national-gold
national-goldβ€’16mo ago
Hey @ahnaf1022, It seems like a missing feature in the useDrawerForm hook. Can you create an issue for this?
vicious-gold
vicious-goldβ€’16mo ago
Thanks, I see you opened the issue on github. When can I expect this feature to be added?
rival-black
rival-blackβ€’16mo ago
Hello @ahnaf1022 right now we are pushing for Refine v4, probably we can deliver around next mid-month. It's also should be easy to add, feel free to create a PR, we can help you go through it πŸš€