diff --git a/web/src/components/config-form/theme/widgets/TextWidget.tsx b/web/src/components/config-form/theme/widgets/TextWidget.tsx index 58eb9b79d..84e809c4d 100644 --- a/web/src/components/config-form/theme/widgets/TextWidget.tsx +++ b/web/src/components/config-form/theme/widgets/TextWidget.tsx @@ -16,6 +16,10 @@ export function TextWidget(props: WidgetProps) { options, } = props; + const isNullable = Array.isArray(schema.type) + ? schema.type.includes("null") + : false; + return ( - onChange(e.target.value === "" ? undefined : e.target.value) + onChange( + e.target.value === "" + ? isNullable + ? null + : undefined + : e.target.value, + ) } onBlur={(e) => onBlur(id, e.target.value)} onFocus={(e) => onFocus(id, e.target.value)} diff --git a/web/src/components/config-form/theme/widgets/TextareaWidget.tsx b/web/src/components/config-form/theme/widgets/TextareaWidget.tsx index 0a2e03305..5eccfb965 100644 --- a/web/src/components/config-form/theme/widgets/TextareaWidget.tsx +++ b/web/src/components/config-form/theme/widgets/TextareaWidget.tsx @@ -16,6 +16,10 @@ export function TextareaWidget(props: WidgetProps) { options, } = props; + const isNullable = Array.isArray(schema.type) + ? schema.type.includes("null") + : false; + return (