Switch UI doesn't update when set using resetFields
See original GitHub issueVersion
3.2.3
Environment
Latest chrome, OS: High-Siera, latest react
Reproduction link
https://codesandbox.io/s/n3rnmmrm50
Steps to reproduce
Select some option from select
input, then turn switch
on and click Submit
button. In console.log, you’ll see the right output. Then, use allowClear
button on Select and click Submit
. You will receive empty formValues in console, which is right, but the switch
will still be on.
What is expected?
Switch should be turned off by using resetFields
function from this.props.form
What is actually happening?
Switch UI is remaining the same, not respecting the value set inside getFieldDecorator
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
antd Switch UI doesn't update after submit - Stack Overflow
If Switch is inside a form, you can reset the form using the form hook method resetForm const [form] = Form.useForm(); const handleChange ......
Read more >useForm - reset - React Hook Form
dirtyFields will be updated again if values are provided: it is set to be result of the comparison between the new values provided...
Read more >Form - Ant Design
High performance Form component with data scope management. ... Select a option and change input text above. Submit Reset Fill form. Form methods....
Read more >Download of Software or Update Data is Stuck or Will Not ...
The information in this article can help you when downloading software on the Nintendo Switch console, the download progress does not begin, is...
Read more >RoboForm Extension for Chrome Version News
Fixed setting "Turn off browser built-in PM" does not turns off autofill of addresses. ... Change design of AutoSave UI to be more...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Switch
don’t havevalue
prop so you have to tell form what prop control its state.Not sure why but that didnt work for me: