when debouceAsync is present, isValidating should still be true in time between sync finishing, and async starting

Aperta
#1,833 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #1971 di @tt-a1i — chiusa senza merge

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Inizia con la riproduzione StackBlitz collegata in src/index.tsx e traccia il flusso di convalida di onChange/onChangeAsync, incluso il debounce di 500 ms. Conferma la transizione di stato tra il completamento della convalida sincrona e l’avvio della convalida asincrona; è completato quando isValidating rimane true per tutto quell’intervallo oppure lo stato sostitutivo viene esposto in modo coerente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

v1 v2: needs investigation
Describe the bug

Im trying to make a form, where part of the validation is done on server, so im using both, onChange and onChangeAsync, the later with onChangeAsyncDemounceMs set to 500.

I noticed that in the time frame between onChange finishing and OnChangeAsync starting I do not have a way to disable submit button, as isValidating is set to true after onChange

Your minimal, reproducible example

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

Steps to reproduce
  1. fill firstname with 'er" - button is dissabled
  2. fill firstname with 'error'- button is enabled (onChange passed)
    and after 500 s (the onChangeAsync fires) the button is disabled again
Expected behavior

When any debouceMs is set, the isValidating should still stay as true, or we should get additional property which would represent that period of time.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

MacOs, chrome

TanStack Form adapter

react-form

TanStack Form version

1.23.7, 1.23.8

TypeScript version

No response

Additional context

No response

Lingua principale
TypeScript
Stelle
6.8k
Fork
717
Merge medio
5g 22h
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TanStack/form

Tutte le issue di TanStack/form

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.