Skip to content

fix(form-core): fix form.resetField() ignoring nested fields #1497

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 2 commits into
base: main
Choose a base branch
from

Conversation

LeCarbonator
Copy link
Contributor

Closes #1496

See the issue for more details.

The main issue is that the field name was assumed to be a shallow keyof TFormData when it is actually DeepKeys<TFormData>. TypeScript didn't complain because there was an as assertion.

This PR implements the unit test provided in the issue and fixes it.

Copy link

nx-cloud bot commented May 9, 2025

View your CI Pipeline Execution ↗ for commit 0b768c4.

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

☁️ Nx Cloud last updated this comment at 2025-05-13 05:09:56 UTC

Copy link

pkg-pr-new bot commented May 9, 2025

More templates

@tanstack/angular-form

npm i https://pkg.pr.new/@tanstack/angular-form@1497

@tanstack/form-core

npm i https://pkg.pr.new/@tanstack/form-core@1497

@tanstack/react-form

npm i https://pkg.pr.new/@tanstack/react-form@1497

@tanstack/lit-form

npm i https://pkg.pr.new/@tanstack/lit-form@1497

@tanstack/solid-form

npm i https://pkg.pr.new/@tanstack/solid-form@1497

@tanstack/svelte-form

npm i https://pkg.pr.new/@tanstack/svelte-form@1497

@tanstack/vue-form

npm i https://pkg.pr.new/@tanstack/vue-form@1497

commit: 0b768c4

Copy link

codecov bot commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.13%. Comparing base (bfb8c42) to head (0b768c4).
Report is 23 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1497      +/-   ##
==========================================
+ Coverage   88.97%   89.13%   +0.15%     
==========================================
  Files          31       31              
  Lines        1397     1417      +20     
  Branches      353      362       +9     
==========================================
+ Hits         1243     1263      +20     
  Misses        137      137              
  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.

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.

form.resetFieldValue() doesn't work for nested fields
2 participants