TanStack / TanStack/form

onChangeListenTo will deactivate onChangeAsync of target

Open
#1,410 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: runtime scope: core type: bug v1
Dominant language
TypeScript
Stars
6.7k
Forks
682
Avg merge
5d 18h
Merged PRs (30d)
7

Description

Describe the bug

Having two form fields, field A with onChangeAsync and field B with onChangeListenTo, the onChangeAsync of field A will never be triggered.
Once the target inside onChangeListenTo is renamed or the whole line is commented out, the onChangeAsync will trigger again.

Your minimal, reproducible example

https://stackblitz.com/edit/tanstack-form-h3v7ps9t?file=src%2Findex.tsx

Steps to reproduce

Open stackblitz reproducible example, type in "error" into the firstname field.
It should trigger an async error after 1 second, but does not.
Comment out the onChangeListenTo in the Last Name form field, then the first name will trigger if "error" is entered.

Expected behavior

onChangeAsync should still work for all fields.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Windows 11, Edge Version 135.0.3179.54

TanStack Form adapter

react-form

TanStack Form version

v1.3.0

TypeScript version

v5.7.3

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproduction and the two fields using onChangeAsync and onChangeListenTo. Reproduce the failure by entering "error" in the firstname field, then trace how the listener affects async change handling; done means the async error still triggers while the listener remains configured.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.