-
-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: should run validation on submit and clear error if a valid value is entered #520
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
9817265
to
897b382
Compare
Hey @crutchcorn, Could you review this please. |
Is there anything currently preventing this from being merged? |
Maintainer is very slow. cc. @tannerlinsley |
I'm not sure when the maintainer will merge this, but is there any other way we can work around these issues temporarily? |
Hey all, maintainer here. @vikaskumar89 I will need you to please start being patient with me. On top of TanStack Form not being 1.x yet (in which case bug fixes will be merged much faster), I also work on various other OSS projects, am trying to finish writing a book, am oftentimes busy with personal issues, and to top it off am not really getting paid for this work (minus a few generous donors albeit for relatively little amounts). Please do not tag Tanner directly, and know that I will eventually come back to things here. There is a reason I am "slow" :) That all said, I will be reviewing this shortly. |
packages/form-core/src/FieldApi.ts
Outdated
cause === 'submit' | ||
? onChange | ||
? onChange | ||
: onBlur |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the correct backup to cause === "submit" && !onChange
Instead, we need to run both onChange
and onBlur
.
I'll take over this PR to make the appropriate changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issues with implementation have now been resolved.
In addition, I've added <Field onSubmit={z.string().min(1)}/>
functionality, which was missing previously.
I also added more tests than before.
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #520 +/- ##
==========================================
+ Coverage 84.55% 91.31% +6.75%
==========================================
Files 9 21 +12
Lines 395 656 +261
Branches 109 179 +70
==========================================
+ Hits 334 599 +265
+ Misses 52 50 -2
+ Partials 9 7 -2 ☔ View full report in Codecov by Sentry. |
I was just hoping to get you attention to this PR. There was no other intent. 😄 |
This PR fixes issue #490 and #486.
What is changed