fix: calendar day view - toolbar onView directly sets page state, Calendar remounts via key

This commit is contained in:
Hermes
2026-08-01 12:33:39 +00:00
parent 60dd5a8280
commit b9cce1e452
+7 -2
View File
@@ -266,7 +266,6 @@ function CalendarPage() {
view={view} view={view}
defaultView={isMobile ? Views.AGENDA : Views.MONTH} defaultView={isMobile ? Views.AGENDA : Views.MONTH}
onNavigate={handleNavigate} onNavigate={handleNavigate}
onView={handleViewChange}
onSelectEvent={handleSelectEvent} onSelectEvent={handleSelectEvent}
onSelectSlot={handleSelectSlot} onSelectSlot={handleSelectSlot}
onEventDrop={handleEventDrop} onEventDrop={handleEventDrop}
@@ -277,7 +276,13 @@ function CalendarPage() {
showMultiDayTimes showMultiDayTimes
components={{ components={{
event: EventComponent, event: EventComponent,
toolbar: (props: any) => <CustomToolbar {...props} currentView={view} />, toolbar: (props: any) => (
<CustomToolbar
{...props}
currentView={view}
onView={(newView: string) => setView(newView)}
/>
),
}} }}
views={["month", "week", "work_week", "day", "agenda"]} views={["month", "week", "work_week", "day", "agenda"]}
step={30} step={30}