-
-
Notifications
You must be signed in to change notification settings - Fork 579
fix: set fields to isBlurred only after field blur event #940
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
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 8aad2b1. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #940 +/- ##
==========================================
- Coverage 86.79% 86.75% -0.05%
==========================================
Files 29 29
Lines 1159 1155 -4
Branches 298 298
==========================================
- Hits 1006 1002 -4
Misses 140 140
Partials 13 13 ☔ View full report in Codecov by Sentry. |
3460639 to
45410e4
Compare
crutchcorn
left a comment
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.
See comment for change required
88b0d8a to
fade2f0
Compare
a2f3923 to
814d347
Compare
fe63182 to
6db0a30
Compare
6cf946c to
aaeb8db
Compare
791c3c1 to
f418fd1
Compare
|
@crutchcorn I implemented the changes as requested and added some more tests, could you please re-check? |
fc13163 to
7d089b0
Compare
Signed-off-by: Pascal Küsgen <[email protected]>
82fa31d to
5a4d4dc
Compare
|
@Balastrong the isBlurred state of the fields in the form are kept now (removed the FYI: you'll need to use // FormApi.ts
handleSubmit = async () => {
this.store.setState((old) => ({
...old,
// Submission attempts mark the form as not submitted
isSubmitted: false,
// Count submission attempts
submissionAttempts: old.submissionAttempts + 1,
}))
// …
}Example Code (JSX):Only shows errors once the field is blurred or the form has been attempted to submit at least once. {(field.form.state.submissionAttempts || field.state.meta.isBlurred) && field.state.meta.errors.length ? (
<em>{field.state.meta.errors.join(',')}</em>
) : null}Demo: |
Balastrong
left a comment
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.
That's great, thank you!
this is a followup for #939