Native Scrolling: Android Testers Wanted


#167

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.


#168

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.


#169

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?


#170

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.

#171

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


#172

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


#173

@bengtler, should be fixed now


#174

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


#175

@perry

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


#176

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


#177

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…


#178

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.


Autoscrolling of ion-view doesn't work on state change when overflow-scroll is true(native scrolling)
#179

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


#180

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


#181

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.


#182

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:


#183

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.


#184

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


#185

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


#186

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