Closed behzadmehrabi closed 2 years ago
Took a look at PR. Interesting idea. I added some comments if you could address those. Also need to think about... did I miss resetting pristine and dirty 🤔
https://github.com/teslamotors/informed/blob/master/__tests__/hooks/useFormApi.test.js#L56
Im trying to think about this ? Should this actually be reset 🤔
Took a look at PR. Interesting idea. I added some comments if you could address those. Also need to think about... did I miss resetting pristine and dirty 🤔
I wrote about it in the PR comments, I think there is a bug.
@Bezmehrabi merged thanks. I will think more on if the pristine thing is a bug. But for now your code is in!
Currently, the
reset
function on field doesn't take any parameter. I think it would be better to make it more flexible by taking parameters such as the value to be reset into and keeping which states. it can be something like:where options are:
there are so many use cases for it, the reason I personally need this is I want to reset the field to some value and reset everything else. so for me, it would be:
AFAIK it's not possible to do at the moment.
I can make PR for it.