jaetask / xstate-form

xstate form integration
MIT License
20 stars 0 forks source link

Separate touched and pristine logic #3

Open jaetask opened 3 years ago

jaetask commented 3 years ago

touched is not the same as pristine

touched is when a field has had focus and been blurred

pristine is when a field has been edited

tomByrer commented 3 years ago

Is this to track filling a form?

A few thoughts: BLUR happens when an element is [TAB] into? You might over-track blind people.

Will a text input become pristine when the contents are deleted manually? If so, perhaps 'filled' is easier to understand by ESL? (Though I do like the pristine word.)

jaetask commented 3 years ago

There is a common way this is interpreted by Formik and Angular etc. The settings above are taken from those, so that there is consistency across libraries.

TAB out is still a blur, this is controlled by the browser