bugfix: date selection in events calendar (#7374)

* Refactor Calendar component to update month details only when year or month changes

* Update web/src/components/Calendar.jsx

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
This commit is contained in:
Sergey Krashevich 2023-08-05 13:48:14 +03:00 committed by GitHub
parent 36ccaa4cff
commit 24365fb865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,9 +102,8 @@ const Calendar = ({ onChange, calendarRef, close, dateRange, children }) => {
...prev, ...prev,
selectedDay: todayTimestamp, selectedDay: todayTimestamp,
monthDetails: getMonthDetails(year, month), monthDetails: getMonthDetails(year, month),
timeRange: { ...dateRange },
})); }));
}, [year, month, getMonthDetails, dateRange]); }, [year, month, getMonthDetails]);
useEffect(() => { useEffect(() => {
// add refs for keyboard navigation // add refs for keyboard navigation