form
form copied to clipboard
Changing 'touched' state to reflect the common notion of 'touched'
@tannerlinsley want to get your thoughts on this. Generally, touched in other frameworks, libraries, etc. represents a field that has been focused/blurred. The touched state in react-form seems to represent dirty, but without the touched state, it's difficult to have a UX that needs to show validation on blur. Currently, with touched representing dirty, validation messaging will immediately populate as soon as a user types one character. For things like email fields this isn't great, as the user likely hasn't finished typing. I understand there is a concept of debounce, but I feel like that is solving something different.
Agreed. This is good. What if the user wants to actually validate as you type tho?
Thinking we’ll need to add a “dirty” state. I can add it to this PR, just wanted to make sure you agreed first 👍
Sounds good to me. Try to keep it all non breaking?
Tanner Linsley On Nov 3, 2019, 8:35 AM -0700, cpepin [email protected], wrote:
Thinking we’ll need to add a “dirty” state. I can add it to this PR, just wanted to make sure you agreed first 👍 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
Btw, really dig the approach you took with all of this.
For sure 👍
Aww thanks man!
Tanner Linsley On Nov 3, 2019, 8:36 AM -0700, cpepin [email protected], wrote:
Btw, really dig the approach you took with all of this. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
I just wanted to bump this as it would be incredibly helpful to our team. Thanks all!
@tmilewski Sorry for the delay, I definitely don't mind pitching in. The more I think about it though - I'm not sure we can do this without a breaking change. It fundamentally changes how touched is working.
@cpepin No worries, I appreciate all the work! I agree. I don't think that there is a way this pans out without a breaking change.
That said, I feel that as long as there's a different way to identify touched it as people have come to expect, doing that and bumping a major version number should be okay.
Tossing in another opinion/bump here - It seems appropriate to bump the major version with this change. I've also struggled with this usage of touched vs dirty where my forms are showing errors earlier than i want them to, but i have no way to defer the showing of errors until a blur occurs
@tannerlinsley what are your thoughts on a major release for this? I don’t mind contributing the code but I’ve been avoiding jumping on it, as I didn’t want to introduce any breaking changes.
anything new about this topic? do you have any workaround for this one?
It's the biggest problem of the lib, dosn't has dirty, because the error is showing earlier... so make the libary useless thinking on UX
Closing this PR for now, as we're working on a substantial rework of the codebase that's expected to undergo more rapid changes as I work on stabilizing things.
Rest assured that we'll have isDirty and isTouched as two distinct items :)
If you'd like to get involved in the rework, join our Discord and reach out in the #form channel