stormy-gold
stormy-goldβ€’2y 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β€’2y 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.
stormy-gold
stormy-goldβ€’2y ago
when I checked autoResetForm only works for useModalForm
provincial-silver
provincial-silverβ€’2y ago
Hey @ahnaf1022, It seems like a missing feature in the useDrawerForm hook. Can you create an issue for this?
stormy-gold
stormy-goldβ€’2y ago
Thanks, I see you opened the issue on github. When can I expect this feature to be added?
correct-apricot
correct-apricotβ€’2y 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 πŸš€