#form.isTouched() not updating its value

8 messages · Page 1 of 1 (latest)

lofty tulip
#

In my attempt to disable a submit button while the form is NOT touched, it seems that form.isTouched() does not have its value updated once its value is changed.
It only seems to update if I do a little change in my code and then save that form.isTouched() gets the updated value.

Is this a react thing? This is the button's code

            Submit
 </Button>```
late lagoon
lofty tulip
#

Just found it! Thanks Vitaly!!

#

@late lagoon checking for form.isDirty() instead seems to change isDirty to true upon "touching" (selecting) a field without actually pressing any keys to change the field's value.

Is this intended behaviour?

#

Even pressing the disabled submit button seems to change isDirty to true and instantly set the button to enabled, too.

lofty tulip
#

Still not found anything.. Any ideas someone? This doesn't seem to be an intended behaviour.

lofty tulip
#

Wow just figured it out... Turns out that google password manager's autofill turns the form dirty but only once the user interacts with the form in any way.

vast plume
#

You found a better way to deal with this? I'm currently having this issue at work. And it bothers me.