fullcalendar / fullcalendar-angular

The official Angular component for FullCalendar
https://fullcalendar.io/docs/angular
MIT License
1.08k stars 177 forks source link

Events get duplicated times when dropping and updating them from the options object #358

Closed johannesjo closed 1 year ago

johannesjo commented 3 years ago

Follow up to: https://github.com/fullcalendar/fullcalendar-angular/issues/357

Steps to recreate:

  1. Go to https://codesandbox.io/s/ecstatic-colden-xernn?file=/src/app/app.component.ts
  2. Start to drag around the tasks in the daily agenda view like a mad man.

Result: Events will be duplicated multiple times until the calendar is completely rererendered (by navigating away and then back).

Is your bug/feature applicable to the core project, without Angular?

I am not sure.

acerix commented 3 years ago

Thanks, I can see the issue but I'm not sure it's a bug in the calendar. It's best if you can provide a more minimal demo, for example by starting with the example project and only adding the code which causes the bug.

https://codesandbox.io/s/github/fullcalendar/fullcalendar-example-projects/tree/master/angular?file=/src/app/app.component.ts

johannesjo commented 3 years ago

Here is a little bit more reduced example: https://codesandbox.io/s/old-wind-7vdf3?file=/src/app/app.component.ts

Please pay attention to line 62. This is the (only) place where the calendar get's updated and the data passed, does not match with what is displayed.

acerix commented 3 years ago

Thanks for the details. I'm not very familiar with how Angular works and was suspicious the issue was related to setInterval but this does seem like a bug now.

johannesjo commented 3 years ago

@acerix yes, it seems so. Looking at the code for the angular integration my suspicion would be that this is at least partly a problem of fullcalendar itself as the correct options get passed as they should.

And if I may say so: Additionally the part with pauseRendering and resumeRendering smells like a race condition looming somewhere :)

johannesjo commented 3 years ago

After playing around with it some more I recognized, that this seems (at least also) to be happening while an event is being dragged around and not necessarily when it is dropped.

EDIT: Though it also happens only after an event was resized.

johannesjo commented 3 years ago

Would you accept PRs in case I find the cause of it? Unfortunately that's a real blocker for Super Productivity's calendar feature.

shyamal890 commented 3 years ago

I am able to reproduce this issue too @acerix

arshaw commented 1 year ago

This ticket is superseded by the other ticket you made @johannesjo: https://github.com/fullcalendar/fullcalendar/issues/6218#issuecomment-1344785330 ↑ Could you please visit the link, give a 👍 to vote (?), press the 🔈Subscribe button to receive updates?

I reopened it and made a new comment