Scrolling in ion-content slow, "sticky" or not working at all

Hi, I’m new to apps and Ionic - I’m having a problem with scrolling on a phone. I have searched here for previous topics but did not find a solution.

My app basically has a home screen with a grid of 3 x 3 icons which lead to just 50 <LI>s of text. These inside screens have a home button and a hamgurger menu. Test results are:

<ion-content overflow-scroll="true">

Android 2.3.6 - No scrolling

Android 4.2.2 - Seem fine

<ion-content overflow-scroll="false">

Android 2.3.6 - Initally scrolls but quickly stops after a lttle navigation around app

Android 4.2.2 - Ditto

In summary overflow-scroll=“false” not relable on either device, overflow-scroll=“true” fine on 4.2 but no use on 2.3

Also, perhaps related, on 4.2 closing the menu by dragging the main screen is a bit “jerky” but OK if you tap the icon.

Using v1.0.0-beta.9 of Ionis and using cordova build android with version 3.5

I’m sure I’ve made major errors in my first code, please feel free to point them out. Thanks in advance!

Index.html

    <!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Ionic Grid</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

    <link href="lib/ionic/css/ionic.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <script src="lib/ionic/js/ionic.bundle.js"></script>
    <script src="js/app.js"></script>
    <script src="cordova.js"></script>
  </head>
 
  <body ng-app="myApp" ng-controller="bodyCtrl">
    <ion-nav-view animation="slide-left-right"></ion-nav-view>

    <script id="grid.html" type="text/ng-template">
     <ion-header-bar class="bar-light">
        <h1 class="title">App name</h1>
      </ion-header-bar>


      <ion-content>
          <div class="row">
            <div class="col">
              <a href="#grid/content_a"><img src="img/content_a.png"></a>
            </div>
            <div class="col">
              <a href="#grid/content_b"><img src="img/content_b.png"></a>
            </div>
            <div class="col">
              <a href="#grid/content_c"><img src="img/content_c.png"></a>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <a href="#grid/content_d"><img src="img/content_d.png"></a>
            </div>
            <div class="col">
              <a href="#grid/content_e"><img src="img/content_e.png"></a>
              </div>
            <div class="col">
              <a href="#grid/content_f"><img src="img/content_f.png"></a>
              </div>
          </div>
          <div class="row">
            <div class="col">
              <a href="#grid/content_g"><img src="img/content_g.png"></a>
            </div>
            <div class="col">
              <a href="#grid/content_g"><img src="img/content_h.png"></a>
            </div>
            <div class="col">
              <a href="#grid/content_i"><img src="img/content_i.png"></a>
            </div>
          </div>
      </ion-content>

    </script>


    <script id="inside.html" type="text/ng-template">
	  <ion-side-menus>
		<!-- Center content -->
		<ion-side-menu-content>
		  <ion-header-bar class="bar-light">

			  <!-- menu show/hide -->
			  <button class="button button-icon" ng-click="toggleMenu()">
				<i class="icon ion-navicon"></i>
			  </button>
			  <h1 class="title">App name</h1>

			  <!-- home button -->
			  <a class="button button-icon" href="#">
				<i class="icon ion-home"></i>
			  </a>
			
			</ion-header-bar>
			<ion-content overflow-scroll="true" >
			<div class="SS_inside_contnt">
			  <h1>true {{title}}</h1>

			  <ol>
			  <li>In faucibus condimentum libero, vel iaculis nibh tristique ac. Nunc vitae urna felis. Praesent lectus ligula, vulputate id dolor at, porttitor pretium nulla. </li>
				<!-- above line repeated 50 times (hard coded) -->
			</ol>

			</div>
			</ion-content>
		 </ion-side-menu-content>

		<!-- Left menu -->
		<ion-side-menu side="left">
		  <ion-header-bar class="bar-light">
			<h1 class="title">Menu</h1>
		  </ion-header-bar>
		  <ion-content>
			<ion-list>
			  <a class="item" href="#grid/content_a">content_a</a>
			  <a class="item" href="#grid/content_b">content_b</a>
			  <a class="item" href="#grid/content_c">content_c</a>
			  <a class="item" href="#grid/content_d">content_d</a>
			  <a class="item" href="#grid/content_e">content_e</ion-item>
			  <a class="item" href="#grid/content_f">content_f</a>
			  <a class="item" href="#grid/content_g">content_g</a>
			  <a class="item" href="#grid/content_h">content_h</a>
			  <a class="item" href="#grid/content_i">content_i</a>
			</ion-list>
		  </ion-content>
		</ion-side-menu>
	  </ion-side-menus>

	</script>
  </body>
</html>

app.js

var myApp = angular.module('myApp', ['ionic']);

myApp.controller('bodyCtrl', function($scope, $ionicSideMenuDelegate) {
$scope.toggleMenu = function() {
    $ionicSideMenuDelegate.toggleLeft();
  };

});

myApp.config(function($stateProvider) {
  $stateProvider
  .state('index', {
    url: '',
    templateUrl: 'grid.html'
  })

  .state('grid', {
    url: '/grid/:page',
    templateUrl: 'inside.html',
    controller: function ($scope, $stateParams) {
        $scope.title =$stateParams.page;
      }
  });
});

custom CSS

.col {text-align: center;}

ion-header-bar img {margin-top: 8px;
    height: 27px;}

.SS_inside_contnt {    width:94%;
    margin : 0 auto;}

    ol {
display: block;
list-style-type: decimal;
}

why do you use overflow scrolling? its optional if you dont like ionics js scroll

try to remove the whole attribute and do it like its shown in one of the examples with lists http://codepen.io/ionic/public-list

ionic officially supports android 4+ (i think) so that could cause some problems as well, your overflow scroll usage should be your first priority though

Is overflow-scroll=“false” not the same as not having the attribute there at all? In any case, I removed it and tried again - same results as setting it to false. I initially did not have it there at all but found a post here saying to turn it on.

I do understand that support for older android is limited, but would have thought scrolling is such a basic thing that it would work

First things first, I’m LOVING Ionic so far. Kudos to everyone involved.

That said, I’ve been hitting the same issue on Android. I have a brand new Nexus 5 for testing on Android, and the same app that was working great on iOS is pretty clunky on the Nexus. By the way, I’m not using overflow-scroll="false".

A few interesting points:

  • Putting an <ion-refresher /> at the top of my <ion-content /> makes scrolling very jittery on Android
  • Even without the <ion-refresher /> scrolling is “sticky” or fails completely after a bit of scrolling, only on Android

Are these known issues?

scrolling should work on your 4+ device with a 99% guarantee, i have no experience with lower versions

yeah youre right, false or non existent should have the same effect i didnt read your “=true” test

without testing any further i see that you use ion-content inside ion-side-menu-content, check your code against the examples i linked and find out if that causes the problem

Hi thanks for your help.

Re " i see that you use ion-content inside ion-side-menu-content" is this not OK? I just followed the example here Or do you mean something else?

i mean the examples on codepen linked before

no idea if that is an issue but i find it easier to play around with codepens to see what works and what doesnt

I’ll trying building some of those examples tomorrow (at home now).

Just getting back to this, have build several of the codepan apps and tried out on both my phones:

http://codepen.io/ionic/pen/mFygh & http://codepen.io/ionic/pen/JsHjf both work well on both phones.

However this http://codepen.io/ionic/pen/nlEqC is slower and “sticks” the odd time so not as good as the two above.

All there use <ion-content> without any attributes yet the first two, which are more complex, out perform the last one which just has some hard coded text as content.

Could scrolling issues have something to with the filesize of index.html?

Could scrolling issues have something to with the filesize of index.html?

BINGO!!! This helped me no-end