jonaszuberbuehler / ion-affix

A directive for Ionic framework for creating affix headers.
MIT License
57 stars 20 forks source link

Error when using content.scrollTo: "Cannot read property 'scrollTop' of null" #31

Open ShadTK opened 5 years ago

ShadTK commented 5 years ago

Hello

I have a situation where I need to scrollTo a certain element of the screen, while keeping sticky headers so the user can keep track of where he is on the list

However, when I invoke content.scrollTo(scrollOffsetX, scrollOffsetY, Time), I get error "Cannot read property 'scrollTop' of null"

Full Error:

TypeError: Cannot read property 'scrollTop' of null at onScroll (http://localhost:8100/build/vendor.js:149155:35) at SafeSubscriber.schedulerFn [as _next] (http://localhost:8100/build/vendor.js:4005:36) at SafeSubscriber.__tryOrUnsub (http://localhost:8100/build/vendor.js:49792:16) at SafeSubscriber.next (http://localhost:8100/build/vendor.js:49739:22) at Subscriber._next (http://localhost:8100/build/vendor.js:49679:26) at Subscriber.next (http://localhost:8100/build/vendor.js:49643:18) at EventEmitterProxy.Subject.next (http://localhost:8100/build/vendor.js:68486:25) at EventEmitterProxy.EventEmitter.emit (http://localhost:8100/build/vendor.js:3979:76) at ScrollView.scroll.onScrollStart (http://localhost:8100/build/vendor.js:50468:34) at ScrollView.setScrolling (http://localhost:8100/build/vendor.js:93544:40)