With ion-content I am trying to create a content area such that it can only be scrolled in one direction at a time. From the docs it seems like it can be done with locking="true". However, as seen in the following example, when you start off scrolling complete vertical or horizontal, it indeed is locked in that direction, but if you start off with an angle, it can now be scrolled in both direction:
ion-content and ion-scroll both behave the same way. It seems like there is no way you can actually lock it. Anyone knows how to fix this behavior?
It seems this is visible even in the zynga scroller, which is where we got our scroll-view.
Since we’re working to ditch js-scrolling soon, I’m not sure if we will do something about this.
@sawchuk I just tried it out, unfortunately it doesn’t seem to fix the issue in my case. Probably this is because I’m not using a slidebox (?) but a simple ion-content instead.
Ah, right. Well, hopefully our issues are connected somehow, and something from this can come in handy in debugging yours. It’s quite possible there’s a larger issue and I just put a bandaid on it.
I just did a quick fix by modifying the self.doTouchMove invocation to restrict on only one direction by comparing the initial touch location and the second touch location. Seems to be working fine right now. (https://github.com/driftyco/ionic/pull/2849)
You could use overflow-scroll="true" on ion-content.
This makes sure you can only swipe horizontally or vertically. Only drawback i can see so far is that the vertical scroll indicator isn’t visible anymore. I’ve used it in the following way: