Native Scrolling: Android Testers Wanted

@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.

@benjaminbertin, I put your workaround code into a demo app and it worked! Thanks! Here are the before and after versions:

Without workaround code (not working): http://play.ionic.io/app/567d47509f42 :disappointed:

With workaround code (working): http://play.ionic.io/app/fcaa41349e8a :smile:

1 Like

Test 1.0 on my Samsung Galaxy Nexus and native scrolling is very cluncky. Sometimes there is no response on scrolling and sometimes the pull to refresh is not triggered or keeps being triggered. I use xwalk, perhaps this has something to do with it?

I just experienced the same with ionic 1.0 release.

=> when clicking on a form’s field, keyboard is hiding it when using native scrolling.

So just can’t use native scrolling on my app currently.

2 Likes

A workaround for those who want to use native scrolling and are using the header-shrink directive:

You need to use $ionicScrollDelegate.$getByHandle('element-delegate-handle-attr-value').getScrollPosition().top instead of relaying on e.detail.scrollTop or e.target.scrollTop because those will become undefined after you turn off js scrolling.

Actually, you can completely depend on $ionicScrollDelegate to get the scrolling position; whether you are using the native or the js scrolling.

Regards.

3 Likes

Hi There,

scrolling is MUCH faster with native Scrolling.

BUT: The Keyboard always overlaps input fields and I cannot see what I am typing.
I am using: android:windowSoftInputMode=“adjustPan”!

Bugs I’ve found.

Scroll animation is not totally smooth (compared to js scroll)
When I open my keyboard the views don’t adapt to the new size and I’m not able to scroll very well