-
-
Notifications
You must be signed in to change notification settings - Fork 424
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(form-core): fix broken sync/async validation state not shifting with array actions (remove,swap,shift,move...) #1324
base: main
Are you sure you want to change the base?
Conversation
View your CI Pipeline Execution ↗ for commit a3bc878.
☁️ Nx Cloud last updated this comment at |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1324 +/- ##
==========================================
+ Coverage 88.86% 88.88% +0.01%
==========================================
Files 28 28
Lines 1275 1286 +11
Branches 332 340 +8
==========================================
+ Hits 1133 1143 +10
- Misses 127 128 +1
Partials 15 15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fd9f83a
to
f19d461
Compare
Async validation & sync validation now is fully synced and thoroughly tested with the new errorSourceMap. This reduces the complexity of using the cumulative errors map significantly and fixes all the issues with validations running on the wrong fields when removing/inserting/moving/shifting array fields. Please review when you have time! Thanks! |
394082e
to
2fdca86
Compare
Whoops messed up the rebase, will fix tomorrow |
This commit updates async validators to ensure source map is synced with full coverage. Fixes "Cannot read properties of undefined" when removing array field TanStack#1323
bb62f3c
to
e79b51b
Compare
Previously we were using a cumulative field errors map maintained at the form api level.
This PR removes that data structure in favor of a errorSourceMap data structure that lives within the FieldMeta for each field. This allows shifting/removing/deleting fields to automatically keep the errorSourceMap in sync.
This will fix #1323 and prevent other bugs from being raised around sync validation not working after other array actions like removing, shifting, swapping, moving, etc...