diff --git a/src/components/DatePicker/DatePickerPopover.jsx b/src/components/DatePicker/DatePickerPopover.jsx index 849565d55..0477168fa 100644 --- a/src/components/DatePicker/DatePickerPopover.jsx +++ b/src/components/DatePicker/DatePickerPopover.jsx @@ -20,6 +20,7 @@ export const DatePickerPopover = ({ getDayContent, ...rest }) => { + const [initialValue] = useState(value); const [originalValue, setOriginalValue] = useState(value); const [isVisible, setIsVisible] = useState(false); @@ -43,6 +44,10 @@ export const DatePickerPopover = ({ }; const handleClickOutside = () => { + if (!value?.to && variant === "range") { + onChange(initialValue); + } + toggleVisibility(); };