Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
135a495907
commit
a902997290
@@ -1069,6 +1069,23 @@ export function CustomFormBuilder() {
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<FormFieldDefsDialog
|
||||
open={fieldsDialogOpen}
|
||||
onOpenChange={setFieldsDialogOpen}
|
||||
fields={formFields}
|
||||
onChange={(next) => {
|
||||
setFormFields(next);
|
||||
// prune values whose keys no longer exist; seed defaults for new keys
|
||||
setFieldValues((prev) => {
|
||||
const out: Record<string, string> = {};
|
||||
for (const f of next) {
|
||||
out[f.key] = prev[f.key] ?? f.default ?? "";
|
||||
}
|
||||
return out;
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user