diff --git a/packages/react-date-picker/src/index.tsx b/packages/react-date-picker/src/index.tsx index 268d6c46b5..4e5852053d 100644 --- a/packages/react-date-picker/src/index.tsx +++ b/packages/react-date-picker/src/index.tsx @@ -94,7 +94,7 @@ export default function DatePicker(props: DatePickerProps) { } setType(curType); } else { - let currentDate = new Date(selectDate || selectPanelDate); + let currentDate = new Date(selectPanelDate); let month = currentDate.getMonth(); if (curType === 'prev') { month -= 1; @@ -107,7 +107,7 @@ export default function DatePicker(props: DatePickerProps) { onPanelChange && onPanelChange(new Date(currentDate), curType); } setSelectPanelDate(curType === 'today' ? today : currentDate); - setSelectDate(curType === 'today' ? today : currentDate); + curType === 'today' && setSelectDate(today); setType('day'); }