scoutforpets / ember-fullcalendar

An Ember Component for FullCalendar and FullCalendar Scheduler
MIT License
39 stars 45 forks source link

eventRender called after event is placed #48

Closed Prabhakar-Poudel closed 5 years ago

Prabhakar-Poudel commented 7 years ago

Originally reported at full-calendar issues. Two methods supported by FC are eventRender and eventAfterRender. Surprisingly in ember-fullcalendar the eventRender callback is executed after all events have been placed in the DOM, as opposed to the ideal behavior on FC documentation.

Here is fiddle using FC

and here is ember twiddle for the same using ember-fullcalendar.

Now try editing events in both examples and see how ember version is not working as expected.

@jamesdixon Could you see for this sometime soon?

jamesdixon commented 7 years ago

@Prabhakar-Poudel thanks for the report and the reproduction. Unfortunately, I don't have time at the moment to dig into this. If you happen to solve the issue, a PR would be much appreciated. Thank you!

jamesdixon commented 7 years ago

@Prabhakar-Poudel I saw your fix, but my concern is that removing the run loop could have adverse affects elsewhere. I haven't been able to test this across the board yet.

Here's a good intro to the run loop: https://guides.emberjs.com/v2.16.0/applications/run-loop/ (if you're curious as to why it's used)

Prabhakar-Poudel commented 7 years ago

@jamesdixon Thanks for the response. But I do have had problems with run loops in the past. Usually run-loops are cheap guns. They work great and get things done in handy. But is very unreliable for many different kind of situations. Having said that, I had to go ahead and work with my clone of the reppo. And so far in about 6 months I have not seen any problem removing the run loop.

jamesdixon commented 7 years ago

@Prabhakar-Poudel I'm not sure I agree with your opinion of run loops, but to each his own 👍 Regardless, I'm about to push out an updated version of this package and after that, I'll do some more testing with your fix. I appreciate the contribution!