-
-
Notifications
You must be signed in to change notification settings - Fork 457
feat(form-core): add array method field.clearValues
and form.clearFieldValues
#1404
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
feat(form-core): add array method field.clearValues
and form.clearFieldValues
#1404
Conversation
View your CI Pipeline Execution ↗ for commit 1f4e90a.
☁️ Nx Cloud last updated this comment at |
The library already adds multiple helper functions for arrays ( Following this principle, I suggest there should be one (or optionally two) helper methods added in this PR:
|
The provided test case will always fail because the |
I'll rewrite the tests to use |
Sounds good. I got an implementation of clearValues ready for testing as well |
5ebd548
to
76cc154
Compare
Since we're adding two new methods, the title should be changed to feat(form-core) so that the bot creates the proper semantic versioning |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1404 +/- ##
==========================================
+ Coverage 89.13% 89.24% +0.11%
==========================================
Files 31 31
Lines 1417 1432 +15
Branches 362 366 +4
==========================================
+ Hits 1263 1278 +15
Misses 137 137
Partials 17 17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
How should Currently:
With this information, I deduced that
Should
|
5aaa21c
to
3c2cfda
Compare
…FieldValues` Co-authored-by: LeCarbonator <[email protected]>
57f8294
to
1884b7b
Compare
field.clearValues
and form.clearFieldValues
e684cef
to
1f4e90a
Compare
LGTM 🚀 |
Problem
When setting a field back to an empty array
items[0].firstName
would still exist - when there's a validation on the firstName (on the Field-level)form.canSubmit
would be false.Solution
Adding array method
field.clearValues
andform.clearFieldValues