Skip to content

fix(FieldApi): avoid triggering onChange validator when an untouched field calls handleBlur#1578

Merged
LeCarbonator merged 1 commit intoTanStack:mainfrom
LeCarbonator:fix-onchange-from-onblur
Jun 12, 2025
Merged

fix(FieldApi): avoid triggering onChange validator when an untouched field calls handleBlur#1578
LeCarbonator merged 1 commit intoTanStack:mainfrom
LeCarbonator:fix-onchange-from-onblur

Conversation

@LeCarbonator
Copy link
Copy Markdown
Contributor

In the current code, if an untouched field is blurred, it triggers an onChange event on top of the onBlur event.
Since this is only achieved by not modifying the value, it shouldn't fire an onChange event.

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Jun 12, 2025

View your CI Pipeline Execution ↗ for commit 5c9ae38.

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

☁️ Nx Cloud last updated this comment at 2025-06-12 16:03:43 UTC

@LeCarbonator LeCarbonator changed the title fix(form-core): avoid triggering onChange validators when an untouched field is blurred fix(FieldApi): avoid triggering onChange validator when an untouched field calls handleBlur Jun 12, 2025
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Jun 12, 2025

More templates

@tanstack/angular-form

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

@tanstack/form-core

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

@tanstack/lit-form

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

@tanstack/react-form

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

@tanstack/solid-form

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

@tanstack/svelte-form

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

@tanstack/vue-form

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

commit: 5c9ae38

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.24%. Comparing base (c001ab3) to head (5c9ae38).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1578      +/-   ##
==========================================
- Coverage   89.25%   89.24%   -0.01%     
==========================================
  Files          31       31              
  Lines        1433     1432       -1     
  Branches      366      366              
==========================================
- Hits         1279     1278       -1     
  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.

@LeCarbonator LeCarbonator merged commit 92e797e into TanStack:main Jun 12, 2025
6 checks passed
@LeCarbonator LeCarbonator deleted the fix-onchange-from-onblur branch June 12, 2025 16:26
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.

2 participants