From cadd9bf4d84c5ace4b02af48f09f5a4a8009dd15 Mon Sep 17 00:00:00 2001 From: araddcc002 Date: Wed, 11 Dec 2024 09:43:36 +0000 Subject: [PATCH] fixed an issue where dates could not be deleted --- frontend/src/MuiForms/DateSelector.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/MuiForms/DateSelector.tsx b/frontend/src/MuiForms/DateSelector.tsx index 6cd5b9452..db078e3ef 100644 --- a/frontend/src/MuiForms/DateSelector.tsx +++ b/frontend/src/MuiForms/DateSelector.tsx @@ -15,7 +15,7 @@ interface DateSelectorProps { readOnly?: boolean formContext?: any value: string - onChange: (newValue: string) => void + onChange: (newValue: string | undefined) => void InputProps?: any } @@ -26,6 +26,8 @@ export default function DateSelector(props: DateSelectorProps) { const handleChange = (dateInput: Dayjs | null) => { if (dateInput && dateInput.isValid()) { onChange(dateInput.format('YYYY-MM-DD')) + } else { + onChange(undefined) } }