Native Scrolling: Android Testers Wanted

Is it possible to have the on-scroll and scroll-event-interval attributes work with native scrolling? Trying it out now, and neither seem to have an effect, while with JS scrolling they do.

I can do something like element.bind(‘scroll’, scope.myFunction); and the scroll events will work (in both native and JS), but the scroll-event-interval will only work with JS scrolling, for native I need wrap my function in a debounce method. Not a deal-breaker at all, but it would be nice to be able to set the interval on the markup, instead of in the function.

tested with ionic rc04 and last nightly:

@perry
If you set overflow-scroll=“true” on ion-content and you are using an infinite-scroll i get the following error in my javascript console:

TypeError: Cannot read property '__container' of undefined
at ionic.bundle.min.js:386
at ionic.bundle.min.js:170
at e (ionic.bundle.min.js:72)
at ionic.bundle.min.js:76

The infinite scroll works, but this error occurs.

I will reply myself.
I could not use native scrolling with horizontal scroll. The reason is that .overflow-scroll by default has overflow-x: hidden.
So, if someone would like to use native horizontal scrolling then need to change .overflow-scroll definition to overflow-x: scroll.

The current problem that I am facing is that I cannot use native scrolling in ion-scroll. @perrygovier, is it possible at all?

1 Like

In rc4:

  • Every page shows an scrollbar (even when there’s no content to scroll).
  • ion-list overlays the scrollbar (I tested and it’s because of z-index in .item-content class)
  • Focus to input still doesn’t work.

Enabling native scrolling stops pull to refresh working entirely at the moment.

1 Like

@neilgoldman305, I’m hoping to keep things as efficient as possible and not bind to any scroll events unless necessary because they fire a lot. You might take a look at ionic.Utils.throttle/debounce to achieve the same results as scroll-event-interval.

If enough people ask for it, I’ll reconsider, but right now, I’m err’ing on the side of keeping things as efficient as possible.

@bengtler, should be fixed now

1 Like

Pull to refresh with native scrolling requires touch, not mouse, events. On desktop Chrome, you can enable touch simulation in the inspector by hitting entering the inspector -> hit escape -> emulation -> sensors -> emulate touch screen

@perry

i only find commits for collection-repeat, but i am using infinite-scroll on native scrolling.
And it still occurs.

@perry, I am using nightly build 1282 and I can still see this issue. I am using global config to disable jsscrolling.

I’m experiencing a problem using the code:

if(!ionic.Platform.isIOS())$ionicConfigProvider.scrolling.jsScrolling(false);

Because it loses android scroll position when going back from an list item, it scrolls back to top automaticaly…

I found a workaround for the scroll to top problem.

I added a service decorator on $location to hide the Ionic $location decorator scrolling to top on every hash change.

In my app config function I added:

function $LocationDecorator($location) {
        $location.hash = function(value) {
        return $location.__hash(value);
    };
    return $location;
}

$provide.decorator('$location', ['$delegate', $LocationDecorator]);

Of course, it would be nice to get rid of these few lines and have Ionic not scroll to top on every hash change.

When the native scrolling will be supported for collection-repeat? @perry

I spent a good bit of time planning it out and building pieces. What I wound up with looked a lot like JS scrolling, so we decided that collection-repeat should force JS scrolling on that page. That’s currently in the nightly

1 Like

Nice @perry but how I will be able to scroll a control (div) with scroll-y if the page has scroll native disabled?

The control if I have the native scroll enabled the scroll works fine but if I have the js scrolling I can’t scroll it.

I could use a ion-scroll in my control but native scroll do that auto. The problem increases when the control is not yours is third party and you need to overwrite the library adding ion scroll :confounded:

Hi, I’ve tested 1.0 version and I’ve simple problem. Following documentation I’ve set scrolling.jsScrolling(false) but I haven’t been able to scroll anything.

@perry there’s still two issues that I’m facing, I didn’t found any alternative solution.

  • When Keyboard is open, scroll doesn’t work at all.
  • Scroll it’s not remembering the position when switch views, whether the cache is enabled or not

This is marked as bug, or it’s something that will be worked on?

Thanks.

1 Like

Can you please put some more context on your code? I’m trying to copy your work around, and not sure how it should be.

Should I be injecting $location into my app’s config function? I get error when I do that because $location is not a provider so it can’t be injected into config.

Thanks

@rastographics I did not inject $location into the config method. It seems weird at second thoughts, but it works.

I just added the few lines I mentioned in my initial post at the end of my angular config method.

Edit: as @elliotwaite noticed, you must inject $provide in your config method.