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<
13151315
13161316 // Default Value
13171317 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
13191322
13201323 const defaultValue = ( opts . defaultValue as unknown ) ?? formDefault
13211324
13221325 // The name is dynamic in array fields. It changes when the user performs operations like removing or reordering.
13231326 // 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+ // }
13331338 }
13341339
13351340 // Default Meta
You can’t perform that action at this time.
0 commit comments