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
Before posting an issue, read the FAQ and search the previous issues.
Description
Maybe a bug, maybe is supposed to be so. Please close if the latter.
I have a complex schema (work with dataType: json), which provides some of the default values. Additionally I generate more data and this is called superForm(defaults(initialData, zod(schema)). If the default values are not in the top level of the object, the default values from schema get overwritten by the provided generated initialData.
defaults.js in superforms
return{id: options?.id??validator.id??'',valid: false,posted: false,errors: {},data: { ...optionDefaults, ...data},// this line should be something like _.merge by lodashconstraints: validator.constraints,shape: validator.shape};
ktarmyshov
changed the title
Defaults from schema are overwritten by provided default data (Deep)
Defaults from schema are overwritten by provided default data (not deep)
Dec 17, 2024
Description
Maybe a bug, maybe is supposed to be so. Please close if the latter.
I have a complex schema (work with dataType: json), which provides some of the default values. Additionally I generate more data and this is called superForm(defaults(initialData, zod(schema)). If the default values are not in the top level of the object, the default values from schema get overwritten by the provided generated initialData.
defaults.js in superforms
If applicable, a MRE
The text was updated successfully, but these errors were encountered: