Skip to content

Conversation

@michaelboyles
Copy link
Contributor

Fixes #1169

"touched" definition in the docs say it's related to the user clicking the field. There isn't even a handler for clicking/focussing the field, so that's not right

The actual definition of touched is blurred/changed

Also added isBlurred and isDefaultValue states to the description, and further clarified that isPristine is just the same as !isDirty

Copy link
Contributor

@harry-whorlow harry-whorlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR! 🙌

Quick question - have you had a chance to check out PR #1456 and the related issues #1080 and [#1081]? I ask because those discussions were the main drivers behind the current layout and structure of the field state documentation. (We had a ton of interaction on those issues, so we wanted to emphasize the reasoning behind our decisions.)

The structure I originally went with was intentional and based on three layers:

General field state – covering value, validation, and errors.
Common interaction states – like isTouched, isDirty, and isPristine, which are most relevant for user interaction.
Introduction of isDefaultValue – added to reflect differences in how isDirty values are handled in React compared to Vue or Angular.
(Though I realize most of this was done in the React docs.)

Would you mind if I pushed a commit to your PR? There are a few things I’d like to tweak, and we can discuss whether they make sense. (I’ll also fix the isPristine type while I’m at it!) 😄

@michaelboyles
Copy link
Contributor Author

Sure, make whichever changes you like. I can fix up too, but probably not til Monday.

The most important thing is that clicking the field is nothing to do with touched state. That's just simply wrong.

@harry-whorlow
Copy link
Contributor

whats your opinion on this? just updated the docs so all the libraries have the "Understanding 'isDirty' in Different Libraries" segment, and reorganised what you wrote a little.

@michaelboyles
Copy link
Contributor Author

There's a typo on the diagrams - isBlured missing an R

I don't personally see the value in having 2 separate diagrams. They seem identical except for the last row, right? I'd use the "extended" one as the only one, with all 5 properties described above, then elaborate on dirty underneath. But not dying on that hill. At least it's accurate now.

Not sure if it was intentional or not, but for Solid you've changed the syntax from field().state.meta to field.state.meta. I'm not a Solid person so I don't know which is correct, but looks like it might be a copy-paste typo.

@harry-whorlow
Copy link
Contributor

@michaelboyles Ah, good catch on the typo!

Yeah, I'm not particularly a fan of the double images, but given that the issues I linked were some of the more interacted-with ones—and people were asking for a clear explanation of our decisions—I don't mind using more space here to emphasise it.

@harry-whorlow
Copy link
Contributor

So this pr is looking good to go!

Thanks for the submission, I'll get around to merging it in a bit. 🚀

@harry-whorlow harry-whorlow merged commit 77acb33 into TanStack:main Jun 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Touched" definition in documentation is wrong

2 participants