-
-
Notifications
You must be signed in to change notification settings - Fork 353
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(core): add field listeners #1032
Conversation
72b762b
to
b154b29
Compare
b154b29
to
e1716e0
Compare
Moved the onSubmit test from FieldApi.spec.ts -> FormApi.spec.ts |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit dba1652. 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 #1032 +/- ##
==========================================
+ Coverage 85.70% 86.06% +0.36%
==========================================
Files 28 28
Lines 1098 1105 +7
Branches 275 275
==========================================
+ Hits 941 951 +10
+ Misses 144 141 -3
Partials 13 13 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
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.
Fantastic PR, very well done! :D
I think you can tick the onSubmit box and go ahead with the docs.
With regards to your comment, I would say yes unless you have a leaning in a different direction... But, I'm completely open to suggestions. |
a0534b5
to
79d1dad
Compare
@Balastrong hot off the press with a first draft for the docs, let me know what you think. Once I get the thumbs up I'll create the Vue and Angular docs. Feel free to offer improvements and tweaks 🤟 |
50c19b5
to
a88f993
Compare
@Balastrong, let me know what you think! if everything looks good I'll finish the Vue and Angular when I get back tonight. Enjoy the weekend!🤟 |
Thank you for following up the original PR 👏 |
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.
Sorry I'm looking at all the tiny details now, but everything else looks really great :)
Please go ahead with the docs for the other frameworks and I think we're good to go!
@Balastrong no please, nitpick away... I'll be the poor sod using it 😂 |
@Balastrong would it be okay to close out this pull request, and leave the angular docs up to the community... It's been a few years since I did angular and most of the documentation is missing from tanstack/form, so its not like I have a reference to compare against. I'll give it a go in the mean time, but if I can't get it, I'll create an issue for it once this is merged. 🤟 [edit] ah, I gave it a go... please double check it though as I'm not the Angular savant |
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.
Angular was missing an explicit Input
definition to expose listeners, I added it now.
Also on the docs I realized we don't have yet the ability to reset a single field, so you either form.reset({...form.state.value, field: ''})
or form.setFieldValue('field', '')
.
Everything else looks good, thank you so much for the PR and all the fixes!
Thanks man! it's been a pleasure working with you. |
Background
From discussion #709 and PR #801
A continuation of the PR #801 that been sitting stale since July, as per the previous pull request:
The PR was given the go ahead by @crutchcorn here.
This is something we would really like to have, as I'm currently experiencing a minor blocker with this functionality missing, and I would prefer to have a clear api as opposed to using the current validators onChange workaround.
Continuation of work
Guidance wanted
Specifically referring to the onSubmit comment made here
Is there a method that I've missed for an "on submit" callback that I can use to set the listeners value inside the FiledApi when the form is submitted? or is this something I need to create and pass down from the form to the field? Just a hint in the correct direction would be really appreciated.
Feel free to fire off any questions, I'll do my best to get back to you in a timely manner.
Looking forward to hearing from the maintainers 🤟