Async validator doesn't re-trigger `isValidating` after first failed validation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.7k
- Forks
- 682
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 7
Description
Describe the bug
When you have a form with an async validator, the field().state.meta.isValidating property doesn't go back to true when you trigger the async validation after the first time.
Your minimal, reproducible example
https://stackblitz.com/~/github.com/AlexanderHott/tanstack-solid-form-async-validator-bug
Steps to reproduce
- Type
admin - See
Checking username...message for 2000ms - Wait for
Username is already taken - Backspace until the username is empty
- Type
asdf
Expected behavior
I expect the Checking username... message to appear again, because the validator is validating, but there is no pending/loading message.
The validator error does show up correctly afterwards.
How often does this bug happen?
Every time
Screenshots or Videos
https://github.com/user-attachments/assets/40bde457-4991-40d0-a9ca-29a32d9d4e29
Platform
- OS: Linux 7.0.0-30-generic
- Browser: Chrome 148.0.7778.178
TanStack Form adapter
solid-form
TanStack Form version
1.33.5
TypeScript version
5.9.3
Additional context
I think the relevant code is here https://github.com/TanStack/form/blob/b865ef335a69aa08a2f160895258f13e03773467/packages/form-core/src/FieldApi.ts#L1508-L1535
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/form-core/src/FieldApi.ts at the linked validation logic, then reproduce the sequence in the provided StackBlitz example using the Solid adapter. Trace why isValidating remains false after the first failed async validation; done means the Checking username... state appears again during the second validation while the validator error still appears afterward.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100