-
-
Notifications
You must be signed in to change notification settings - Fork 502
fix(core): fix deleteField method #1706
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
base: main
Are you sure you want to change the base?
Conversation
View your CI Pipeline Execution ↗ for commit dfd06c5
☁️ Nx Cloud last updated this comment at |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1706 +/- ##
==========================================
- Coverage 90.52% 90.48% -0.04%
==========================================
Files 37 37
Lines 1688 1692 +4
Branches 421 423 +2
==========================================
+ Hits 1528 1531 +3
- Misses 143 144 +1
Partials 17 17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Please, verify the idea. If I'm thinking in a proper direction I will proceed and add unit tests. |
During implementing this and testing
deleteField
I found out that this method does not work.When a form field has
onChange
validation and thedeleteField
method is called on it, an error appears.error: https://bolt.new/~/vitejs-vite-ceu2fl73
I think flow look like this:
form.deleteField('firstName')
.values
soonChange
validator runs.errors.fields.email = 'error message'
- sovalidateSync
tries to update metadata of deleted field.setFieldMeta
callsfunctionalUpdate
withundefined
(since field does not exists infieldMetaBase
)....prev
whereprev
now is undefined -> error.So
validateSync
iterates through field list that already semes to be outdated. There is a checkif (!fieldMeta)
in this function but I guess we have to add as wellif (!fieldMetaBase)
.