FullCalendar shows events duplicated on modification
See original GitHub issueReduced Test Case
https://codesandbox.io/s/zealous-jepsen-190d2?file=/src/DemoApp.jsx
Bug Description
If I press down on an event, move it, release the mouse button, press the mouse button again, -> can drag a copy of the event
Screenshots
From the minimal working example
In the app, with some more hooks/delay it works close to every time. The title is rendered as the title is calculated in eventDidMount
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:19 (4 by maintainers)
Top Results From Across the Web
FullCalendar shows events duplicated on modification #7071
This issue occurs exactly when you are dragging an event, at the same time that a React setState occurs in the background (in...
Read more >Events are duplicated when switching months in Fullcalendar v4
Events are loaded correctly, but when I manually add a new one (it is also saved to SQL database via ajax call), then...
Read more >FullCalendar - Javascript Event Calendar - Duplicate Events
In agenda week/day view, when we use timely events (With allDay: false ) it is showing duplicate events in other days as well....
Read more >How do I add and duplicate an event in the Calenda...
Once created in a course calendar, duplicate events are not linked together and are independent events. Therefore, if users need to modify an...
Read more >Event Object - Docs | FullCalendar
String. Events that share a groupId will be dragged and resized together automatically. · Boolean ( true or false ). Determines if the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@arshaw I still have the issue with your solution (even in your codesandbox). Please, try to drag and drop an event into a different time slot and immediately after dropping the event, re-drag it (within the 2 seconds) to another time slot without dropping it, you will see that the event is still duplicated.
This issue occurs exactly when you are dragging an event, at the same time that a React setState occurs in the background (in this case in the setTimeout callback). This causes a render of the component. Thus, the events given to FullCalendar through the events props are displayed again.
When the render occurs, it is like the moving event is unsync with the initial dragging event when a render occurs during the move. Thus, when dropping, FullCalendar creates a broad new event.
Same issue on fullcalendar-vue 5.3.0
In my case, this code is used on every eventDrop:
Edit:
I also checked your react example @arshaw , and it still duplicates: