@@ -125,10 +125,6 @@ export class FieldApi<TData, TFormData> {
125
125
? state . meta . error
126
126
: undefined
127
127
128
- if ( state . value !== this . prevState . value ) {
129
- this . validate ( 'change' , state . value as never )
130
- }
131
-
132
128
this . prevState = state
133
129
this . state = state
134
130
} ,
@@ -206,17 +202,13 @@ export class FieldApi<TData, TFormData> {
206
202
getValue = ( ) : typeof this . _tdata => {
207
203
return this . form . getFieldValue ( this . name )
208
204
}
205
+
209
206
setValue = (
210
207
updater : Updater < typeof this . _tdata > ,
211
208
options ?: { touch ?: boolean ; notify ?: boolean } ,
212
209
) => {
213
- this . form . setFieldValue ( this . name , updater as any , options )
214
- this . store . setState ( ( prev ) => {
215
- return {
216
- ...prev ,
217
- value : updater as any ,
218
- }
219
- } )
210
+ this . form . setFieldValue ( this . name , updater as never , options )
211
+ this . validate ( 'change' , this . state . value )
220
212
}
221
213
222
214
getMeta = ( ) : FieldMeta => this . form . getFieldMeta ( this . name )
@@ -250,7 +242,7 @@ export class FieldApi<TData, TFormData> {
250
242
form : this . form ,
251
243
} )
252
244
253
- validateSync = async ( value = this . state . value , cause : ValidationCause ) => {
245
+ validateSync = ( value = this . state . value , cause : ValidationCause ) => {
254
246
const { onChange, onBlur } = this . options
255
247
const validate =
256
248
cause === 'submit' ? undefined : cause === 'change' ? onChange : onBlur
0 commit comments