Tap on list item returning earlier list item when scrolling on ios device


#1

So I have this weirdest behaviour happing in a scroll list on an iOS device.
Say i have a list of a 100 movies like this:

  <ion-list>
    <ion-item ng-repeat="movie in featuredCtrl.movies" on-tap="featuredCtrl.goToMovie(movie, $event);">
      {{movie.Name}}
    </ion-item>
  </ion-list>

If I tap a movie I alert the movie name.
This works perfectly in android and in the browser.
On iOS however if i scroll the list and tap ‘movie 20’ i get an alert with ‘movie 13’, which is the movie on which i started my scroll.
If i wait untill the scroll is completely finished I get the correct movie.

So i created a completely new starter app to test this behaviour but I couldn’t get it reproduced.
Untill I set the

$ionicConfigProvider.scrolling.jsScrolling(false);

parameter in my config value.
This should be default but apparently it makes a difference when you explicitely set the option!
Now i have this lag behaviour in my app.
Has anybody else seen this behaviour?


#2

yep i recognized this behavior, too.
It it is not the item you started your scrolling. but it is something like a timing/calculation issue in the javascript scrolling of ionic.

if you wait until the scrolling has finished you will not get any problems, but sometimes you get an item which was on this “postition” where you tapped.

JS is very bad at calculations and if you need dom-access for calcution like js does --> it is very slow. So maybe the lag between calculation and real scrolling causes this.

PS: i think js is default-scroll behave again, because some parts in icon does not work correctly without js-scrolling.


#3

It’s very annoying.
I have a list of movie poster on which a user can tap.
But they end up at a a different movie then the poster they tap on when they scroll the list.


#4

yep, i need js scrolling in some places so i tried collection-repeat (smaller dom) but it worked neither.

So only solution is - as you mentrioned - to hard deactivate js-scrolling


#5

but the problem is even when I hard deactivate it (with that config code), it still goes wrong!
Only if i don’t add the config value at all (and it defaults to native scrolling) then it works as intended.

The problem is that I then have other issues.
So i’m stuck between a rock and a hard place :frowning: