seankenny / fullcalendar

Full-sized drag & drop event calendar (jQuery plugin)
http://arshaw.com/fullcalendar/
MIT License
60 stars 39 forks source link

Cannot read property 'id' of undefined when dragging out-of-bounds #60

Closed nx-dev02 closed 8 years ago

nx-dev02 commented 8 years ago

Hi. I'm currently working on a project and I used this fork from Demo 2.0.2.

I'm having an error that says "Uncaught TypeError: Cannot read property 'id' of undefined" when I try to drag an event outside the calendar. To be specific, on the right side where the scrollbar is located. Normally, it would just go back to where it was placed before dragging if it is not placed properly on a column. But the event will disappear and will only re-appear when you drag/resize the other events.

I noticed that it happens on the demo too. Try moving a card to "Resource 3" then move the card towards the scrollbar. You'll notice that the event will disappear.

I think this happens to everyone except that they never encountered it before.

If anyone can clarify this for me that would be great. This is a great plugin. Looking forward for more improvements/features.

Thank you!

jozkee commented 8 years ago

I found a simple solution, not too much good lookign but its something

if ((origCell.col + resourceDelta) < 0 || (origCell.col + resourceDelta) > getResources().length - 1) isInBounds = false;

that must go before this if (isInBounds && (isAllDay || resourceDelta || snapDelta))

seankenny commented 8 years ago

Should be fixed now in 2.0.3.