File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -1315,21 +1315,26 @@ export class FieldApi<
1315
1315
1316
1316
// Default Value
1317
1317
if ( ( this . state . value as unknown ) === undefined ) {
1318
- const formDefault = getBy ( opts . form . options . defaultValues , opts . name )
1318
+ const formDefault = getBy (
1319
+ opts . form . options . defaultValues ,
1320
+ opts . name ,
1321
+ ) . value
1319
1322
1320
1323
const defaultValue = ( opts . defaultValue as unknown ) ?? formDefault
1321
1324
1322
1325
// The name is dynamic in array fields. It changes when the user performs operations like removing or reordering.
1323
1326
// In this case, we don't want to force a default value if the store managed to find an existing value.
1324
- if ( nameHasChanged ) {
1325
- this . setValue ( ( val ) => ( val as unknown ) || defaultValue , {
1326
- dontUpdateMeta : true ,
1327
- } )
1328
- } else if ( defaultValue !== undefined ) {
1329
- this . setValue ( defaultValue as never , {
1330
- dontUpdateMeta : true ,
1331
- } )
1332
- }
1327
+
1328
+ // TODO test what is actually needed here
1329
+ // if (nameHasChanged) {
1330
+ // this.setValue((val) => (val as unknown) || defaultValue, {
1331
+ // dontUpdateMeta: true,
1332
+ // })
1333
+ // } else if (defaultValue !== undefined) {
1334
+ // this.setValue(defaultValue as never, {
1335
+ // dontUpdateMeta: true,
1336
+ // })
1337
+ // }
1333
1338
}
1334
1339
1335
1340
// Default Meta
You can’t perform that action at this time.
0 commit comments