fix(frontend): prevent Select.Item crash on empty-string enum values

Radix UI's Select.Item throws when value="". The SelectWidget used
value={value ?? ""} which passes empty string for null/undefined form
values, and passed enum options through without filtering.

- Use value || undefined to show placeholder for unset values
- Filter out empty-string options before rendering SelectItems

Resolves SECRT-2157
This commit is contained in:
Otto
2026-03-20 09:16:09 +00:00
parent f01f668674
commit 8ab5d7bd20

View File

@@ -61,13 +61,15 @@ export const SelectWidget = (props: WidgetProps) => {
hideLabel={true}
disabled={disabled || readonly}
size={selectSize as any}
value={value ?? ""}
value={value || undefined}
onValueChange={onChange}
options={
enumOptions?.map((option: any) => ({
value: option.value,
label: option.label,
})) || []
enumOptions
?.filter((option: any) => option.value !== "")
.map((option: any) => ({
value: option.value,
label: option.label,
})) || []
}
wrapperClassName="!mb-0 "
className={className}