ui-calendar icon indicating copy to clipboard operation
ui-calendar copied to clipboard

"Cannot read property 'scrollTop' of null" Error

Open youngcademy opened this issue 8 years ago • 20 comments

angular-ui-calendar make error below

angular.js:13920 TypeError: Cannot read property 'scrollTop' of null at constructor.getScrollTop (fullcalendar.js:9026) at members.constructor.queryScroll (fullcalendar.js:11873) at members.constructor.displayEvents (fullcalendar.js:8428) at renderEvents (fullcalendar.js:9761) at reportEvents (fullcalendar.js:9794) at fullcalendar.js:10659 at _fetchEventSource (fullcalendar.js:10708) at fetchEventSource (fullcalendar.js:10630) at fetchEvents (fullcalendar.js:10624) at fetchAndRenderEvents (fullcalendar.js:9785)(anonymous function) @ angular.js:13920

How Do I?

youngcademy avatar Nov 01 '16 00:11 youngcademy

up, i have similar problem with this. also i can't show my event item, they just blinking, like displaying event item for milliseconds then disappeared.

putuyoga avatar Nov 01 '16 01:11 putuyoga

Yes. I have same ploblem too. likewise I can't show events.

youngcademy avatar Nov 01 '16 01:11 youngcademy

Do you resolve the problem?

youngcademy avatar Nov 01 '16 01:11 youngcademy

i did not. Still searching workaround for this one.

putuyoga avatar Nov 01 '16 01:11 putuyoga

okay. If I resolve this problem I write how resolve.

youngcademy avatar Nov 01 '16 01:11 youngcademy

i solve this issue, by using older version of fullcalendar, instead latest version, i use v2.1.1.

putuyoga avatar Nov 01 '16 01:11 putuyoga

Thank you. I solve too by you.

youngcademy avatar Nov 01 '16 05:11 youngcademy

It's working with fullcalendar 2.1.1 Please update your bower json and push to repository :) 👍

ib1987 avatar Feb 02 '17 22:02 ib1987

Any resolution for this issue? It is still replicable when there are events attached to the calendar. I am using latest version of the fullcalendar 3.0.1 with angular ui calendar of 1.0.1.

nikhileshcs avatar Mar 17 '17 10:03 nikhileshcs

Same here

salarelv avatar Mar 19 '17 11:03 salarelv

@nikhileshcs just use the old version 2.1.1 instead the newer one

putuyoga avatar Mar 20 '17 02:03 putuyoga

@putuyoga using the old version will also limit the functionality of the calendar and new features/fixes on the calendar cannot be used.

Instead i used $timeout wrapper to attach events to the scope model to solve this issue. The issue is due to the calendar is not yet rendered on the DOM but few operations are trying to get the scrollEl. Hence here am delaying the events assignment by using $timeout wrapper. @salarelv this might solve your issue for the newer version too.

nikhileshcs avatar Mar 20 '17 05:03 nikhileshcs

@putuyoga The problem with using 2.1.1 is that I don't think it supports jQuery 3.x.

theblang avatar Mar 23 '17 22:03 theblang

Yes. I have same ploblem too. likewise I can't show events.

wcmboy avatar Apr 05 '17 08:04 wcmboy

Any resolution for this issue? It is still replicable when there are events attached to the calendar. I am using latest version of the fullcalendar 2.7.1 with angular ui calendar of 1.0.2.

wcmboy avatar Apr 05 '17 09:04 wcmboy

I've had the same problem with FullCalendar 2.7.1 and Angular UI calendar 1.0.2. I follow the @putuyoga advice and works now.

geovannyAvelar avatar Apr 15 '17 15:04 geovannyAvelar

Hi @putuyoga @geovannyAvelar Can you please explain in more detailed how you implemented your $timeout wrapper that delays the events assignment. I'm new to all this. Thank you so much.

david-hsn avatar Jun 13 '17 15:06 david-hsn

I've had the same problem. @putuyoga advice solved this issue.

Maryna-Yelakova avatar Oct 27 '17 14:10 Maryna-Yelakova

we are struggling with this issue... also we cannot revert cause we use some new functionalities of calendar which are not available on new version.

any advice?

shakisha avatar Nov 27 '17 22:11 shakisha

This comment https://github.com/angular-ui/ui-calendar/issues/340#issuecomment-293678056 may help you.

I solved it simply by doing an ng-if - it needs to wait til the data is there

<div ui-calendar ng-model="eventSources" ng-if="eventSources.length > 0"></div>

This solution is similar to the solution suggested by @nikhileshcs and simpler.

qilab avatar May 11 '18 08:05 qilab