ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Scrolling issue: Other item is selected on IOS-device than is visually clicked

Open BramDecuypere opened this issue 10 years ago • 5 comments

Note: If you are having problems formatting your issue please refer to this article on using markdown in Github:

https://guides.github.com/features/mastering-markdown/

Note: for support questions, please use one of these channels:

https://forum.ionicframework.com/ http://ionicworldwide.herokuapp.com/

Short description of the problem:

[DEVICE-IOS-ONLY] USE CASE: We have a list of items that contain an image(about 1/3th of the screen in height - 100% width) with some extra info. So around 45% of the view is taken/item. While having a scroll-y movement and immediately selecting one of the items we are selecting the wrong item. (eg not the one we visually clicked on)

What behavior are you expecting?

Clicking on a item we should be able to open(push a new page) with the relevant data of this selected item.

Steps to reproduce:

  1. Start the IOS device with a list of items with an image full-width and some text.
  2. Make a scroll-movement down and immediately select an item.
  3. Look at an item that is not the selected item and have a blank stare in your eyes on WTF is going on (just trollin')
  4. Thanking the ionic team for working on this amazing project, and hoping we can somehow fix this together :)

Code below is a super stripped down version: (I'll try to create a demo soon)

<ion-content #content>
    <ion-refresher (ionRefresh)="doRefresh($event)">
        <ion-refresher-content></ion-refresher-content>
    </ion-refresher>

    <ion-list *ngIf="list.items.length > 0">
        <a ion-item *ngFor="let item of list.items" (click)="goToDetailPage(item)">
            <pre>{{ item | json}}</pre>
        </a>
    </ion-list>

    <ion-infinite-scroll (ionInfinite)="doInfinite($event)" threshold="30%">
        <ion-infinite-scroll-content></ion-infinite-scroll-content>
    </ion-infinite-scroll>
</ion-content>

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc) I think a related issue is on how the scroll event is currently handled by IOS. (Not sure if there is a difference between android/ios but I cannot reproduce this problem on an android device or in an ionic serve mode)

maybe it is related to #7617 but I'm not sure

Which Ionic Version? 1.x or 2.x 2 beta 11

Plunker that shows an example of your issue

For Ionic 1 issues - http://plnkr.co/edit/Xo1QyAUx35ny1Xf9ODHx?p=preview

For Ionic 2 issues - http://plnkr.co/edit/me3Uk0GKWVRhZWU0usad?p=preview

Run ionic info from terminal/cmd prompt: (paste output below)

BramDecuypere avatar Aug 11 '16 08:08 BramDecuypere

Hello, I don't have a solution but I have quite the same issue. On iOS and Android-Devices, not in the browser. I have an open issue on the official Ionic Forums: https://forum.ionicframework.com/t/clicking-on-list-card-element-after-scrolling-sometimes-wrong-item/60155

NeckbreakerPascal avatar Aug 16 '16 09:08 NeckbreakerPascal

Hello everyone! This is most likely caused by scroll events being broken and wonky on uiwebview. We are currently making the switch to wkwebview which fixes this issue with scroll events. Keep a lookout on our blog today for a post about wkwebview and Ionic!

jgw96 avatar Aug 18 '16 18:08 jgw96

Hello everyone! Would you all mind testing with our new wkwebview plugin https://github.com/driftyco/cordova-plugin-wkwebview-engine and seeing if you have the same issue? Thanks!

jgw96 avatar Aug 22 '16 16:08 jgw96

Hi @jgw96, tried the WKWebView engine, was first having some CORS issue but this plugin fixed that: https://github.com/apache/cordova-plugins/tree/master/wkwebview-engine-localhost.

This issue is gone, however, another scrolling issue still exists: where you tap the status bar and it doesn't scroll to top but does some erratic scrolling all over the place.

daviddk avatar Aug 24 '16 07:08 daviddk

Thanks for testing, we are working on the cors issues at the moment 😄 . Im glad that wkwebview fixed this issue! Would you mind opening a new issue for the new bug you ran in to? Thanks! Also, since the original issue here is fixed by wkwebview, and eventually once our plugin gets to the stable stage and merged with cordova it is going to be our default, i will be closing this issue for now. Thanks for using Ionic!

jgw96 avatar Aug 24 '16 15:08 jgw96