You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/framework/svelte/guides/basic-concepts.md
+32-11Lines changed: 32 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,33 +72,54 @@ Example:
72
72
73
73
## Field State
74
74
75
-
Each field has its own state, which includes its current value, validation status, error messages, and other metadata. You can access a field's state using the `field.state` property.
75
+
Each field has its own state, which includes its current value, validation status, error messages, and other metadata. You can access a field's state using the `field().state` property.
76
76
77
77
Example:
78
78
79
-
```ts
79
+
```tsx
80
80
const {
81
81
value,
82
82
meta: { errors, isValidating },
83
-
} =field.state
83
+
} =field().state
84
84
```
85
85
86
86
There are four states in the metadata that can be useful to see how the user interacts with a field:
87
87
88
88
-_"isTouched"_, after the user changes the field or blurs the field
89
-
-_"isDirty"_, after the field's value has been changed, even if it's been reverted to the default. Opposite of _"isPristine"_
90
-
-_"isBlurred"_, after the field has been blurred (exited)
91
-
-_"isDefaultValue"_, whether the field's current value is the default value
89
+
-_"isDirty"_, after the field's value has been changed, even if it's been reverted to the default. Opposite of `isPristine`
90
+
-_"isPristine"_, until the user changes the field value. Opposite of `isDirty`
Copy file name to clipboardExpand all lines: docs/framework/vue/guides/basic-concepts.md
+32-11Lines changed: 32 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,33 +76,54 @@ Example:
76
76
77
77
## Field State
78
78
79
-
Each field has its own state, which includes its current value, validation status, error messages, and other metadata. You can access a field's state using the `field.state` property.
79
+
Each field has its own state, which includes its current value, validation status, error messages, and other metadata. You can access a field's state using the `field().state` property.
80
80
81
81
Example:
82
82
83
-
```js
83
+
```tsx
84
84
const {
85
85
value,
86
86
meta: { errors, isValidating },
87
-
} =field.state
87
+
} =field().state
88
88
```
89
89
90
90
There are four states in the metadata that can be useful to see how the user interacts with a field:
91
91
92
92
-_"isTouched"_, after the user changes the field or blurs the field
93
-
-_"isDirty"_, after the field's value has been changed, even if it's been reverted to the default. Opposite of _"isPristine"_
94
-
-_"isBlurred"_, after the field has been blurred (exited)
95
-
-_"isDefaultValue"_, whether the field's current value is the default value
93
+
-_"isDirty"_, after the field's value has been changed, even if it's been reverted to the default. Opposite of `isPristine`
94
+
-_"isPristine"_, until the user changes the field value. Opposite of `isDirty`
0 commit comments