When using Horizontal Scroll ion-scroll page can't be scrolled down in y-direction

Actually, commenting out that part under ionic.bundle.js worked for me!

And thanks for opening that ticket.

Sal

Does anyone have a plunker/codepen/jsfiddle demonstrating @bra1n’s solution??? Seems to do nothing for me.

I’ve tried various stuff with ion-scrolls under an ion-content, currently I’m trying to get simple extra wide div inside an “overflow-x: scroll” div to work inside an ion-content, this works not in an ion-content and also doesn’t work inside an ion-content with overflow scroll set to true??

I’ll see If I can knock up some examples:

So this is my baseline plunker…

http://embed.plnkr.co/V3v41add8akvRgPJF819/preview (no angular, no ionic, just plain html/css)

^^ This works just fine

This is my baseline ionic plunker with ion-content and ion-scrolls…

http://embed.plnkr.co/09ptI7QCzvwTeLeGIVnr/preview (ionic beta 13, with a horizontally scrollable ion-scroll’s and a div holding div “item boxes”)

^^ This works fine horizontally, but not vertically (the ion-content page does not scroll up and down)

Finally, if you remove the ion-scrolls, this happens:

http://embed.plnkr.co/eOWV8KRPnAH2UmZQs4pK/preview (ionic beta 13, ion-scrolls NOT used, just plain divs)

^^ the page scrolls up and down but the plain 'ol divs stop scrolling horizontally, setting overflow-scroll=“true” on the ion-content makes no difference, other than the page doesn’t even scroll!

WOOOHHOOO!!! I just tried @bra1n 's solution by minifying my own ionic bundle:

http://embed.plnkr.co/wNXBNuDZqFQI4UcQIk3X/preview

^^ Yes it “does” work, but how can we fix this properly?

Adding link to ticket: https://github.com/driftyco/ionic/pull/2606

1 Like

Any update on this @jcsmith1859?

I made a change to @bra1n codepen example, and created a horizontal-scroll-fix directive that override touchStart for child scroll views (or ion-content). So no need to patch ionic.bundle.js.

See http://codepen.io/walm/pen/wBoReG

On a device (or Chrome simulating touch events) go to http://s.codepen.io/walm/debug/wBoReG
it only works for touch so no mouse, and ok with iOS and Android.
Also it locks main scroll when doing horizontal scrolling.

Is scrolling locked or ignored on the image? This works fine for me with the exception of putting your finger on the image and trying to scroll does nothing?

Image was in a iframe and then Safari try to use it’s own scroll.
I change to img tag and all good.

1 Like

Good stuff :grinning:

I might update my plunker example above using some of your code…

Is this stuff still necessary in beta 14?

Yes, still need this in beta 14. I’ve updated so it now use beta 14 in example.

Is there a good way to do that without using $ionicScrollDelegate.$getByHandle(). I need that for a infinite scroll element with lots of horizontal scroll boxes. I want a dynamic way of bubbling up the event so we know the handle with the event. not choosing it manually.

override touchStart solution works fine. Only problem with this solution is it jumps. I mean when i try to do horizontal scroll, screen slightly moves vertically also. Is there any way to lock the vertical scroll while doing the horizontal scroll ?

I’m trying to mimic the Netflix UI so I need a lot of horizontal scrolling images that can also scroll vertically. I was trying to use the directive solution from here without much luck until I realized all my horizontal images had the same delegate handle. When I gave them different handles it worked great. Thanks guys.

Yet to fully check… but I think the fixes mentioned above still look like they are needed in rc.0

Confirmed, this still works in rc.2

Confirmed, still works in rc.3

Any better solution, without @bra1n monkey-patch?

Confirmed, still works in v1.0.0

No better solution that I know of

This may help you. I forked it from some one in code pen. This is working fine for me.

^^^ Thats’ a heck of a lot of code, compared to commenting 20-30 characters.

Confirmed, still works in v1.0.1

this seems to work,but still there is some vertical movement when i try to scroll horizontally.i think there is no fix for this issue

Yes, you are right. I can little movement in vertical direction, when i am trying to scroll horizontally.