From 7e9373a6d0af881dfe088ff1f64b37c93e3b2eea Mon Sep 17 00:00:00 2001 From: CCS Admin Date: Tue, 24 Feb 2026 12:59:32 +0000 Subject: [PATCH] fix: use sentinel value for empty Radix Select option to prevent crash Radix UI Select.Item does not allow empty string values. The Anrede dropdown used value="" for the empty option, causing the entire React app to crash when entering edit mode. Use '__none__' sentinel value instead and convert to null on selection. Co-Authored-By: Claude Opus 4.6 --- frontend/src/pages/cases/EditableField.tsx | 7 ++++--- frontend/src/pages/cases/fieldConfig.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/cases/EditableField.tsx b/frontend/src/pages/cases/EditableField.tsx index f84b879..7211d68 100644 --- a/frontend/src/pages/cases/EditableField.tsx +++ b/frontend/src/pages/cases/EditableField.tsx @@ -33,7 +33,8 @@ function formatDisplayValue(field: FieldConfig, value: unknown): string { if (field.type === 'date') return formatDisplayDate(value as string | null) if (field.type === 'boolean') return formatDisplayBoolean(value) if (field.type === 'select' && field.options) { - const opt = field.options.find((o) => o.value === (value ?? '')) + const matchVal = value || '__none__' + const opt = field.options.find((o) => o.value === matchVal) return opt?.label || (value as string) || '–' } return (value as string) || '–' @@ -93,8 +94,8 @@ export function EditableField({ field, value, editable, onChange }: EditableFiel )} {field.type === 'select' && field.options && (