When I use setValue to set initial values to the form it sets the touched to true for that field.
Therefore the dirty flag goes to true.
I may be wrong, but I think when we want to use setValue in the code, witch does not mean user interaction, we want the form to remain untouched and not dirty.
Maybe we could send in a flag to say I want the form to be dirty or not via setValue:
setValue('field' , 10, validate = true, setTouched=false) : something like that.
if you just want to set value for the input as the initial value. you can use reset() or defaultValues. That wouldn't trigger touched or dirty.
Thanks! It works!
Awesome lib!!!
Thank you :)
Most helpful comment
Thanks! It works!
Awesome lib!!!