diff --git a/app/form/fields.ts b/app/form/fields.ts index aabfa0015..6fb8cf96d 100644 --- a/app/form/fields.ts +++ b/app/form/fields.ts @@ -519,7 +519,6 @@ export function dayMonthYearRequired(args: DateTimeArgs) { }); } -// xxx: should validate for duplicates too (if any duplicates -> error) export function checkboxGroup( args: WithTypedTranslationKeys< WithTypedItemLabels< @@ -531,6 +530,7 @@ export function checkboxGroup( return z .array(itemsSchema(args.items)) .min(args.minLength ?? 0) + .refine((val) => val.length === R.unique(val).length) .register(formRegistry, { ...args, label: prefixKey(args.label),