From 34236c9572d4f079477dd33f9979251e9de82198 Mon Sep 17 00:00:00 2001 From: Alex Netsch Date: Thu, 27 Nov 2025 18:15:46 +0000 Subject: [PATCH] Fix duplicate None/null options (#1384) fmt --- frontend/src/components/rjsf/widgets/SelectWidget.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/rjsf/widgets/SelectWidget.tsx b/frontend/src/components/rjsf/widgets/SelectWidget.tsx index ff79d484..5476dde6 100644 --- a/frontend/src/components/rjsf/widgets/SelectWidget.tsx +++ b/frontend/src/components/rjsf/widgets/SelectWidget.tsx @@ -41,10 +41,14 @@ export const SelectWidget = (props: WidgetProps) => { // Convert enumOptions to the format expected by our Select component const selectOptions = enumOptions || []; - // Handle nullable types by adding a null option + // Handle nullable types by adding a null option and filtering out null from enumOptions + // (schema has null in both type and enum, but String(null) breaks validation) const isNullable = Array.isArray(schema.type) && schema.type.includes('null'); const allOptions = isNullable - ? [{ value: '__null__', label: 'None' }, ...selectOptions] + ? [ + { value: '__null__', label: 'Not specified' }, + ...selectOptions.filter((opt) => opt.value !== null), + ] : selectOptions; return (