Replies: 2 comments
-
The native HTML file input gets cleared when you cancel the file selection dialog; this is the default behavior of the browser. |
Beta Was this translation helpful? Give feedback.
-
Yes I understand that, I was trying to make a workaround for it. I was saving the original file onclick and then replaced it onchange if the browser cleared the native file. I used setValue to do this. When I console logged watch, getValues, and my submit function, all three would say that the file was there but if I made the field required it would reject submission. In hindsight maybe it's not the best idea to try and override the browser. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Version Number
"^7.47.0"
Codesandbox/Expo snack
https://codesandbox.io/s/holy-dust-7m87sp?file=/src/App.tsx
Steps to reproduce
Expected behaviour
The form will submit without required field errors
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions