djett41 / ionic-scroll-sista

An Ionic plugin that hides the header/tabs while scrolling
MIT License
125 stars 38 forks source link

Doesn't work with ionic#1.2.1 - native scrolling issue #30

Closed mixersoft closed 8 years ago

mixersoft commented 8 years ago

I get an exception at Uncaught TypeError: Cannot read property 'scrollTop' of undefined

          $element.bind('scroll', function (e) {
            if (isNavBarTransitioning) {
              return;
            }
            //support for jQuery event as well
            e = e.originalEvent || e;

            var duration = 0;
            var scrollTop = e.detail.scrollTop;  // exception thrown here

<ion-content overflow-scroll="false"> fixes the issue by forcing JS scroll

mixersoft commented 8 years ago

This seems to make it work with native scrolling

var scrollTop = scrollView.isNative ? e.currentTarget.scrollTop : e.detail.scrollTop;
mixersoft commented 8 years ago

added pull request