Skip to content

Commit 31547b1

Browse files
committed
Merge branch 'main' into valibot-form-adapter
2 parents 3e46d8b + 2fc941e commit 31547b1

File tree

19 files changed

+691
-63
lines changed

19 files changed

+691
-63
lines changed

examples/react/simple/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
"preview": "vite preview"
99
},
1010
"dependencies": {
11-
"@tanstack/react-form": "0.7.0",
11+
"@tanstack/react-form": "0.7.2",
1212
"axios": "^0.26.1",
1313
"react": "^18.0.0",
1414
"react-dom": "^18.0.0",
15-
"@tanstack/form-core": "0.7.0",
16-
"@tanstack/vue-form": "0.7.0",
17-
"@tanstack/zod-form-adapter": "0.7.0",
18-
"@tanstack/yup-form-adapter": "0.7.0",
19-
"@tanstack/solid-form": "0.7.0"
15+
"@tanstack/form-core": "0.7.2",
16+
"@tanstack/vue-form": "0.7.2",
17+
"@tanstack/zod-form-adapter": "0.7.2",
18+
"@tanstack/yup-form-adapter": "0.7.2",
19+
"@tanstack/solid-form": "0.7.2"
2020
},
2121
"devDependencies": {
2222
"@vitejs/plugin-react": "^4.0.4",

examples/react/yup/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
"preview": "vite preview"
99
},
1010
"dependencies": {
11-
"@tanstack/react-form": "0.7.0",
11+
"@tanstack/react-form": "0.7.2",
1212
"axios": "^0.26.1",
1313
"react": "^18.0.0",
1414
"react-dom": "^18.0.0",
1515
"yup": "^1.3.2",
16-
"@tanstack/form-core": "0.7.0",
17-
"@tanstack/yup-form-adapter": "0.7.0",
18-
"@tanstack/vue-form": "0.7.0",
19-
"@tanstack/zod-form-adapter": "0.7.0",
20-
"@tanstack/solid-form": "0.7.0"
16+
"@tanstack/form-core": "0.7.2",
17+
"@tanstack/yup-form-adapter": "0.7.2",
18+
"@tanstack/vue-form": "0.7.2",
19+
"@tanstack/zod-form-adapter": "0.7.2",
20+
"@tanstack/solid-form": "0.7.2"
2121
},
2222
"devDependencies": {
2323
"@vitejs/plugin-react": "^4.0.4",

examples/react/zod/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
"preview": "vite preview"
99
},
1010
"dependencies": {
11-
"@tanstack/react-form": "0.7.0",
11+
"@tanstack/react-form": "0.7.2",
1212
"axios": "^0.26.1",
1313
"react": "^18.0.0",
1414
"react-dom": "^18.0.0",
1515
"zod": "^3.21.4",
16-
"@tanstack/form-core": "0.7.0",
17-
"@tanstack/zod-form-adapter": "0.7.0",
18-
"@tanstack/vue-form": "0.7.0",
19-
"@tanstack/yup-form-adapter": "0.7.0",
20-
"@tanstack/solid-form": "0.7.0"
16+
"@tanstack/form-core": "0.7.2",
17+
"@tanstack/zod-form-adapter": "0.7.2",
18+
"@tanstack/vue-form": "0.7.2",
19+
"@tanstack/yup-form-adapter": "0.7.2",
20+
"@tanstack/solid-form": "0.7.2"
2121
},
2222
"devDependencies": {
2323
"@vitejs/plugin-react": "^4.0.4",

examples/vue/simple/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
"serve": "vite preview"
1010
},
1111
"dependencies": {
12-
"@tanstack/form-core": "0.7.0",
13-
"@tanstack/vue-form": "0.7.0",
12+
"@tanstack/form-core": "0.7.2",
13+
"@tanstack/vue-form": "0.7.2",
1414
"vue": "^3.3.4",
15-
"@tanstack/react-form": "0.7.0",
16-
"@tanstack/zod-form-adapter": "0.7.0",
17-
"@tanstack/yup-form-adapter": "0.7.0",
18-
"@tanstack/solid-form": "0.7.0"
15+
"@tanstack/react-form": "0.7.2",
16+
"@tanstack/zod-form-adapter": "0.7.2",
17+
"@tanstack/yup-form-adapter": "0.7.2",
18+
"@tanstack/solid-form": "0.7.2"
1919
},
2020
"devDependencies": {
2121
"@vitejs/plugin-vue": "^4.3.4",

examples/vue/yup/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
"serve": "vite preview"
1010
},
1111
"dependencies": {
12-
"@tanstack/form-core": "0.7.0",
13-
"@tanstack/vue-form": "0.7.0",
14-
"@tanstack/yup-form-adapter": "0.7.0",
12+
"@tanstack/form-core": "0.7.2",
13+
"@tanstack/vue-form": "0.7.2",
14+
"@tanstack/yup-form-adapter": "0.7.2",
1515
"vue": "^3.3.4",
1616
"yup": "^1.3.2",
17-
"@tanstack/react-form": "0.7.0",
18-
"@tanstack/zod-form-adapter": "0.7.0",
19-
"@tanstack/solid-form": "0.7.0"
17+
"@tanstack/react-form": "0.7.2",
18+
"@tanstack/zod-form-adapter": "0.7.2",
19+
"@tanstack/solid-form": "0.7.2"
2020
},
2121
"devDependencies": {
2222
"@vitejs/plugin-vue": "^4.3.4",

examples/vue/zod/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
"serve": "vite preview"
1010
},
1111
"dependencies": {
12-
"@tanstack/form-core": "0.7.0",
13-
"@tanstack/vue-form": "0.7.0",
14-
"@tanstack/zod-form-adapter": "0.7.0",
12+
"@tanstack/form-core": "0.7.2",
13+
"@tanstack/vue-form": "0.7.2",
14+
"@tanstack/zod-form-adapter": "0.7.2",
1515
"vue": "^3.3.4",
1616
"zod": "^3.21.4",
17-
"@tanstack/react-form": "0.7.0",
18-
"@tanstack/yup-form-adapter": "0.7.0",
19-
"@tanstack/solid-form": "0.7.0"
17+
"@tanstack/react-form": "0.7.2",
18+
"@tanstack/yup-form-adapter": "0.7.2",
19+
"@tanstack/solid-form": "0.7.2"
2020
},
2121
"devDependencies": {
2222
"@vitejs/plugin-vue": "^4.3.4",

packages/form-core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tanstack/form-core",
3-
"version": "0.7.0",
3+
"version": "0.7.2",
44
"description": "Powerful, type-safe, framework agnostic forms.",
55
"author": "tannerlinsley",
66
"license": "MIT",

packages/form-core/src/FieldApi.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { type DeepKeys, type DeepValue, type Updater } from './utils'
2-
import type { FormApi, ValidationErrorMap } from './FormApi'
31
import { Store } from '@tanstack/store'
4-
import type { Validator, ValidationError } from './types'
2+
import type { FormApi, ValidationErrorMap } from './FormApi'
3+
import type { ValidationError, Validator } from './types'
4+
import type { DeepKeys, DeepValue, Updater } from './utils'
55

66
export type ValidationCause = 'change' | 'blur' | 'submit' | 'mount'
77

@@ -243,6 +243,7 @@ export class FieldApi<
243243
unsubscribe()
244244
if (!preserveValue) {
245245
delete info.instances[this.uid]
246+
this.form.deleteField(this.name)
246247
}
247248

248249
if (!Object.keys(info.instances).length && !preserveValue) {
@@ -494,7 +495,7 @@ export class FieldApi<
494495
}
495496

496497
// Always return the latest validation promise to the caller
497-
return this.getInfo().validationPromise ?? []
498+
return (await this.getInfo().validationPromise) ?? []
498499
}
499500

500501
validate = (
@@ -504,6 +505,10 @@ export class FieldApi<
504505
// If the field is pristine and validatePristine is false, do not validate
505506
if (!this.state.meta.isTouched) return []
506507

508+
try {
509+
this.form.validate(cause)
510+
} catch (_) {}
511+
507512
// Store the previous error for the errorMapKey (eg. onChange, onBlur, onSubmit)
508513
const errorMapKey = getErrorMapKey(cause)
509514
const prevError = this.getMeta().errorMap[errorMapKey]

0 commit comments

Comments
 (0)