fix(form-core): remove 500ms fallback for asyncDebounceMs

* test(form-core): add async validation tests

* chore(form-core): remove old asyncDebounceMs api

* Revert "chore(form-core): remove old asyncDebounceMs api"

This reverts commit cd7dbc11ec3acdc529d77df10dc1f990f8a7bfcf.

* fix(form-core): make sure to fallback to asyncDebounceMs

* chore(form-core): remove 500ms fallback

---------

Co-authored-by: João Pedro Magalhães <joaopsilvamagalhaes@gmail.com>
This commit is contained in:
João Pedro Magalhães
2023-09-03 21:00:04 -03:00
committed by GitHub
parent de22b6c38a
commit 3b7f6c16ba
3 changed files with 266 additions and 29 deletions

View File

@@ -165,8 +165,6 @@ export class FieldApi<TData, TFormData> {
update = (opts: FieldApiOptions<typeof this._tdata, TFormData>) => {
this.options = {
asyncDebounceMs: this.form.options.asyncDebounceMs ?? 0,
onChangeAsyncDebounceMs: this.form.options.onChangeAsyncDebounceMs ?? 0,
onBlurAsyncDebounceMs: this.form.options.onBlurAsyncDebounceMs ?? 0,
...opts,
} as never
@@ -312,7 +310,7 @@ export class FieldApi<TData, TFormData> {
? onChangeAsyncDebounceMs
: onBlurAsyncDebounceMs) ??
asyncDebounceMs ??
500
0
if (this.state.meta.isValidating !== true)
this.setMeta((prev) => ({ ...prev, isValidating: true }))