Skip to content

Commit 20cbf2f

Browse files
committed
* form-builder: fix default value handling in FormBuilder by ensuring fallback to an empty string when no default value is provided, improving data integrity.
1 parent 2db3648 commit 20cbf2f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/form-builder/src/components/form-builder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ export class FormBuilder extends HElement<FormBuilderOptions> {
557557
}
558558
} else {
559559
const key = (schema.type === 'array' && schema.items) ? `${path}[]` : path;
560-
map[key] = data ?? JSON.parse(JSON.stringify(schema.defaultValue ?? this.typeDefaultValueMap[schema.type]));
560+
map[key] = data ?? JSON.parse(JSON.stringify(schema.defaultValue ?? this.typeDefaultValueMap[schema.type] ?? ''));
561561
}
562562
return map;
563563
}

0 commit comments

Comments
 (0)