Skip to content

fix(react-form): remap listener paths in withFieldGroup #1654

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kusiewicz
Copy link
Contributor

@kusiewicz kusiewicz commented Aug 1, 2025

Closes #1644

Currently, when using the withFieldGroup HOC, the field names provided in the validators.onChangeListenTo and validators.onBlurListenTo arrays are not remapped to their full paths within the form state. This causes linked field validation to fail, as the form cannot find the fields it's supposed to be listening to.

  • new method, remapFieldProps, has been added to the FieldGroupApi.
  • the useFieldGroup hook in @tanstack/react-form now calls this new core method for each Field and AppField rendered within the group.

Copy link

nx-cloud bot commented Aug 1, 2025

View your CI Pipeline Execution ↗ for commit c1d8eb1

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 2m 8s View ↗
nx run-many --target=build --exclude=examples/** ✅ Succeeded 19s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-02 15:06:25 UTC

Copy link

pkg-pr-new bot commented Aug 1, 2025

Copy link

codecov bot commented Aug 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.48%. Comparing base (f975f03) to head (c1d8eb1).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1654      +/-   ##
==========================================
+ Coverage   90.38%   90.48%   +0.09%     
==========================================
  Files          36       36              
  Lines        1623     1640      +17     
  Branches      386      390       +4     
==========================================
+ Hits         1467     1484      +17     
  Misses        139      139              
  Partials       17       17              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LeCarbonator
Copy link
Contributor

The function to remap listeners should go in form-core/FieldGroupApi instead.

However, I like the idea and approach! Let me know if you want help on this PR.

@kusiewicz kusiewicz force-pushed the field-group-mapping-fix branch from 9724dbe to 4725028 Compare August 1, 2025 21:18
@kusiewicz
Copy link
Contributor Author

The function to remap listeners should go in form-core/FieldGroupApi instead.

However, I like the idea and approach! Let me know if you want help on this PR.

Yes... make sense :) Updated and added tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Docs] withFieldGroup corrections
2 participants