Issue with Android 4.4 and Horizontal Scrolling
Short description of the problem:
Tried to build a NetFlix style layout with multiple horizontal scrolling content containers on the page within a main scrollable area within <ion-view> via a main <ion-content> container. The layout also had a left side menu with drag-content="false".
I attempted two implementations of the horizontal scrollers, via <ion-content> as well as <ion-scrolling> but in either case swiping left or right on these elements yielded no result on Android 4.4. I also tried a custom solution with a simple <div style='overflow-x: scroll; white-space: nowrap;'></div>
Since I didn't need a draggable side menu, I commented out all gesture handling code in ionic.bundle.js in the ^ionSideMenus section. Despite having drag-content='false', the gesture handling code still seems to impact horizontal swipe gestures on the aforementioned types of scrolling elements. Commenting out everything related to gesture handling (i.e. everything after //add gesture handlers and before //cleanup) seemed to solve this.
Perhaps setting drag-content to false ought to disable whatever is interfering with the swipe gesture on horizontally scrollable elements on Android 4.4. Unfortunately I'm not familiar enough with the codebase or the specifics of the webview in 4.4 to figure out where exactly the issue is. I've seen the issue across multiple 4.4 devices as well as the 4.4 emulator.
Steps to reproduce:
- Start with an example side menus template
- Set
drag-contentto false - Create a horizontally scrollable element via
<ion-scroll direction='x'> - Try to swipe horizontally on a device running Android 4.4 or the 4.4 emulator
Which Ionic Version? 1.x or 2.x
Version 1.2.4
Run ionic info from terminal/cmd prompt: (paste output below)
Cordova CLI: 5.0.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS
Node Version: v4.3.0
Thanks for the detailed issue! We really appreciate it! Would you mind posting some code (codepen, repo etc) so that we can easily repro your issue?
I've created a repo here: https://github.com/fareesh/ionic-5803
The scroller will not work if you swipe left, however, if you longpress, drag upwards a bit and then drag left, it will scroll. This starts to work as intended when the sidemenu gesture handling code is commented out from ionic.bundle.js.
+1 I am having the same issue,
+1
+1, Does someone found a solution to this issue?
+1
@adamdbradley why did You removed the bug label? This really looks like a bug.
I can confirm that commenting out line gestureOpts.prevent_default_directions = ['left', 'right'] inside source of ionSideMenuContent directive fixes the scrolling but breaks side menu open with content dragging.
I've found some old hack for this kind of situations and after few modifications i've figured out how to enable horizontal scroll. Working example is on my fork of @fareesh repo: https://github.com/aszmyd/ionic-5803
And here are the changes: https://github.com/fareesh/ionic-5803/compare/master...aszmyd:master
+1 i am also faceing same issues
Hi every one, I am facing same issue. Please help me.
Thanks, I just found the solution with this example : http://codepen.io/anon/pen/dGpzrp
I also fixed by using the solution found by @fkamlesh
Hello all! As their seems to be a valid workaround for this issue and we do not plan on doing major scroll changes to Ionic 1 I am going to be closing this issue for now. Thanks everyone!