[v2-b11 iOs] Clicking ion-item in ion-list, instantly after a scroll event, opens wrong item
Description of the problem
I've setup an ion-list which is filled with ion-items generated by an *ngFor, each item is an object containing some information. For this testcase I've stripped it down to only an ID. The ion-item displays the Item ID, and a click event is bound to it, which opens a detail page and displays the corresponding ID.
When scrolling slowly through the list and clicking an item af the scroll event has finished, the right page is opened. However, when quickly scrolling through the list of ion-items and instantly after clicking an item, the wrong page is opened. Seems like the momentum scrolling effect is somehow interfering with fast navigation.
I've tested 2 cases:
- As described by the docs: <a ion-item (click)="openItem(item.id)"> In this case, I get the problem as stated above
- <ion-item (click)="openItem(item.id)"> In this case, you can see the momentum scrolling effect/scroll event is stopped on a first tap, but with this setup, tapping an item is quite unresponsive in most cases. Opening an item requires 2 or 3 taps.
Another testcase, that fixes this issue, is using the VirtualScroll and VirtualItem directives, however.. these don't play along nicely with pull to refresh and infinite scroll.
Expected behaviour
Clicking Item with ID 5 should always open page with ID 5.
How to reproduce
- clone our repo: https://github.com/Euricom/tryout-ionic2
- run the app on your device, since it only happens on iOs (or in the emulator) (npm i & ionic run ios)
- in the sidemenu go to the list page
- quickly scroll down and instantly click an item, note which ID you clicked, the opened page will almost always contain the wrong ID.
Sorry, no plunker, since its really iOs only.
Cordova CLI: 6.1.1 Gulp version: CLI version 3.9.0 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.11 Ionic CLI Version: 2.0.0-beta.37 Ionic App Lib Version: 2.0.0-beta.20 ios-deploy version: 1.8.6 ios-sim version: Not installed OS: Mac OS X El Capitan Node Version: v6.1.0 Xcode version: Xcode 7.3 Build version 7D175
Hello! Thanks for opening an issue with us! I am going to be closing this issue as a duplicate of https://github.com/driftyco/ionic/issues/7660. Thanks for using Ionic!