fix: calendar day view - key-based remount workaround for react-big-calendar DnD

This commit is contained in:
Hermes
2026-08-01 12:32:13 +00:00
parent 4693f81095
commit 60dd5a8280
+3 -10
View File
@@ -255,7 +255,9 @@ function CalendarPage() {
</div> </div>
<div className="rbc-calendar-container" style={{ minHeight: isMobile ? 400 : 600 }}> <div className="rbc-calendar-container" style={{ minHeight: isMobile ? 400 : 600 }}>
{/* Key={view} forces remount on view change (workaround for react-big-calendar DnD day view issue) */}
<DragAndDropCalendar <DragAndDropCalendar
key={'cal-' + view + '-' + (isMobile ? 'm' : 'd')}
localizer={localizer} localizer={localizer}
events={calendarEvents} events={calendarEvents}
startAccessor="start" startAccessor="start"
@@ -275,16 +277,7 @@ function CalendarPage() {
showMultiDayTimes showMultiDayTimes
components={{ components={{
event: EventComponent, event: EventComponent,
toolbar: (props: any) => ( toolbar: (props: any) => <CustomToolbar {...props} currentView={view} />,
<CustomToolbar
{...props}
currentView={view}
onView={(newView: string) => {
props.onView(newView);
setView(newView);
}}
/>
),
}} }}
views={["month", "week", "work_week", "day", "agenda"]} views={["month", "week", "work_week", "day", "agenda"]}
step={30} step={30}