Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian24 committed Nov 5, 2023
2 parents 0e5dc38 + 281dc0f commit 232740c
Show file tree
Hide file tree
Showing 18 changed files with 676 additions and 60 deletions.
12 changes: 6 additions & 6 deletions examples/react/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/react-form": "0.7.1",
"@tanstack/react-form": "0.8.0",
"axios": "^0.26.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"@tanstack/form-core": "0.7.1",
"@tanstack/vue-form": "0.7.1",
"@tanstack/zod-form-adapter": "0.7.1",
"@tanstack/yup-form-adapter": "0.7.1",
"@tanstack/solid-form": "0.7.1"
"@tanstack/form-core": "0.8.0",
"@tanstack/vue-form": "0.8.0",
"@tanstack/zod-form-adapter": "0.8.0",
"@tanstack/yup-form-adapter": "0.8.0",
"@tanstack/solid-form": "0.8.0"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.4",
Expand Down
12 changes: 6 additions & 6 deletions examples/react/yup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/react-form": "0.7.1",
"@tanstack/react-form": "0.8.0",
"axios": "^0.26.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"yup": "^1.3.2",
"@tanstack/form-core": "0.7.1",
"@tanstack/yup-form-adapter": "0.7.1",
"@tanstack/vue-form": "0.7.1",
"@tanstack/zod-form-adapter": "0.7.1",
"@tanstack/solid-form": "0.7.1"
"@tanstack/form-core": "0.8.0",
"@tanstack/yup-form-adapter": "0.8.0",
"@tanstack/vue-form": "0.8.0",
"@tanstack/zod-form-adapter": "0.8.0",
"@tanstack/solid-form": "0.8.0"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.4",
Expand Down
12 changes: 6 additions & 6 deletions examples/react/zod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"preview": "vite preview"
},
"dependencies": {
"@tanstack/react-form": "0.7.1",
"@tanstack/react-form": "0.8.0",
"axios": "^0.26.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"zod": "^3.21.4",
"@tanstack/form-core": "0.7.1",
"@tanstack/zod-form-adapter": "0.7.1",
"@tanstack/vue-form": "0.7.1",
"@tanstack/yup-form-adapter": "0.7.1",
"@tanstack/solid-form": "0.7.1"
"@tanstack/form-core": "0.8.0",
"@tanstack/zod-form-adapter": "0.8.0",
"@tanstack/vue-form": "0.8.0",
"@tanstack/yup-form-adapter": "0.8.0",
"@tanstack/solid-form": "0.8.0"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.4",
Expand Down
12 changes: 6 additions & 6 deletions examples/vue/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"serve": "vite preview"
},
"dependencies": {
"@tanstack/form-core": "0.7.1",
"@tanstack/vue-form": "0.7.1",
"@tanstack/form-core": "0.8.0",
"@tanstack/vue-form": "0.8.0",
"vue": "^3.3.4",
"@tanstack/react-form": "0.7.1",
"@tanstack/zod-form-adapter": "0.7.1",
"@tanstack/yup-form-adapter": "0.7.1",
"@tanstack/solid-form": "0.7.1"
"@tanstack/react-form": "0.8.0",
"@tanstack/zod-form-adapter": "0.8.0",
"@tanstack/yup-form-adapter": "0.8.0",
"@tanstack/solid-form": "0.8.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.3.4",
Expand Down
12 changes: 6 additions & 6 deletions examples/vue/yup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"serve": "vite preview"
},
"dependencies": {
"@tanstack/form-core": "0.7.1",
"@tanstack/vue-form": "0.7.1",
"@tanstack/yup-form-adapter": "0.7.1",
"@tanstack/form-core": "0.8.0",
"@tanstack/vue-form": "0.8.0",
"@tanstack/yup-form-adapter": "0.8.0",
"vue": "^3.3.4",
"yup": "^1.3.2",
"@tanstack/react-form": "0.7.1",
"@tanstack/zod-form-adapter": "0.7.1",
"@tanstack/solid-form": "0.7.1"
"@tanstack/react-form": "0.8.0",
"@tanstack/zod-form-adapter": "0.8.0",
"@tanstack/solid-form": "0.8.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.3.4",
Expand Down
12 changes: 6 additions & 6 deletions examples/vue/zod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"serve": "vite preview"
},
"dependencies": {
"@tanstack/form-core": "0.7.1",
"@tanstack/vue-form": "0.7.1",
"@tanstack/zod-form-adapter": "0.7.1",
"@tanstack/form-core": "0.8.0",
"@tanstack/vue-form": "0.8.0",
"@tanstack/zod-form-adapter": "0.8.0",
"vue": "^3.3.4",
"zod": "^3.21.4",
"@tanstack/react-form": "0.7.1",
"@tanstack/yup-form-adapter": "0.7.1",
"@tanstack/solid-form": "0.7.1"
"@tanstack/react-form": "0.8.0",
"@tanstack/yup-form-adapter": "0.8.0",
"@tanstack/solid-form": "0.8.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.3.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/form-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanstack/form-core",
"version": "0.7.1",
"version": "0.8.0",
"description": "Powerful, type-safe, framework agnostic forms.",
"author": "tannerlinsley",
"license": "MIT",
Expand Down
12 changes: 8 additions & 4 deletions packages/form-core/src/FieldApi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type DeepKeys, type DeepValue, type Updater } from './utils'
import type { FormApi, ValidationErrorMap } from './FormApi'
import { Store } from '@tanstack/store'
import type { Validator, ValidationError } from './types'
import type { FormApi, ValidationErrorMap } from './FormApi'
import type { ValidationError, Validator } from './types'
import type { DeepKeys, DeepValue, Updater } from './utils'

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

Expand Down Expand Up @@ -495,7 +495,7 @@ export class FieldApi<
}

// Always return the latest validation promise to the caller
return this.getInfo().validationPromise ?? []
return (await this.getInfo().validationPromise) ?? []
}

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

try {
this.form.validate(cause)
} catch (_) {}

// Store the previous error for the errorMapKey (eg. onChange, onBlur, onSubmit)
const errorMapKey = getErrorMapKey(cause)
const prevError = this.getMeta().errorMap[errorMapKey]
Expand Down
Loading

0 comments on commit 232740c

Please sign in to comment.