I am working with Full Calendar with React.
This is my code
<FullCalendar
ref={calendarRef}
editable={true}
headerToolbar={{ start: '', center: '', end: '' }}
plugins={[timeGridPlugin, interaction]}
initialView="timeGridWeek"
selectable={true}
select={onDateSelect}
eventDrop={onEventDrop}
eventResize={onEventResize}
eventContent={(args) => renderEventContent(args)}
allDaySlot={false}
events={events}
/>
And I have 2 callbacks eventDrop and eventResize
const onEventDrop = (event) => {
const slot = { ...event.event._def.extendedProps };
const delta = event.delta;
slot.date = new Date(slot.date);
slot.date.setHours(0, 0, 0, 0)
slot.date.setDate(slot.date.getDate() + delta.days)
slot.startTime += (delta.milliseconds / 1000)
slot.endTime += (delta.milliseconds / 1000)
updateSlot(id, slot.id, slot).then(() => {
loadSlots()
}).catch(() => {
event.revert()
})
}
const onEventResize = (event) => {
const slot = { ...event.event._def.extendedProps };
slot.startTime += (event.startDelta.milliseconds / 1000)
slot.endTime += (event.endDelta.milliseconds / 1000)
updateSlot(id, slot.id, slot).then(() => {
loadSlots()
}).catch(() => {
event.revert()
})
}
for some reason the events aren't called always, the event itself gets dragger and resized and its reflected to the view But the callback isn't triggered I couldn't find the exact time when its not called, but it works sometimes then it stops I tried a different event and it works, then it stops, its mostly random
Is there any reported bug about this issue, or do I have an issue in the code?
Regards,