However, when trying to scroll, I often am taken into a ticket by accident. I can scroll a little bit, but seems to always eventually get caught being taken into a post I didn’t want to view. It’s like the click event is not smart enough to not fire when I am trying to scroll.
Is there any way to make this behave more intelligently and feel more “native”?
Registering clicks is a quite delicate piece of the framework that has its own platform specific quirks. Quite a lot of work has gone into this already but there are still adjustments being made nearly every release.
In order to debug this it’s important to know on which platform you’re experiencing this issue: desktop / iOS device / iOS simulator / Android (version)?
I have compiled the app and installed on both iOS 7.1 and Android 4.4 (Nexus 5). Both platforms have the same behavior of sometimes registering the clicks when trying to scroll.
Also, if an item in the list has action buttons that I can swipe to reveal, swiping to close them often also fires the click on the list item and takes me into another screen.
@adam The issue is with infinite scroll and the dom/bindings updating. I tested by loading 300 items at once and then scrolling. While the performance was poor, no clicks were improperly registered on scrolling. When you load 10 at a time though, sometimes the scroll “hangs up” and a click is registered. Obviously several ways you could approach this. One is you could prevent clicks until the scroll.infiniteScrollComplete is completed. However, that may cause other issues. Another and better way imo is that you could make sure while loading a new set that there is always a buffer of scroll space below the content before any data is even sent so there isn’t an issue with there being no travel at the bottom. Essentially a “bounce” space at the bottom.
He gives a good example of a 50k list that scrolls very fast on mobile. One of the few times the two way bindings in Angular aren’t really your friend, let alone the DOM size.
bindonce doesn’t help. In my scenario I show a list of cards. Even with only a low number of items (~30) scrolling gets laggy. Actually the biggest performance hit is infinite-scrolling. Instead of stopping the scrolling and then loading the data, it seems to me as the scrolling continues while adding new items. If I scroll realy fast I trigger multiple infinite loads resulting in stutterig. I will investigate further what does happen and if there is a workaround.
Are you changing the distance of the scroll? I found changing it from the default of 1% caused it to fire twice or three times after scrolling for a bit. Performance was much better at 1%. Not a permanent fix but it will do for now.
Yes I know this issue has been fixed with recent commits to the nightly build but it appears tap events now take longer to fire in my test device - Android 4.1.2. Most times I get to tap like 2/3 times to enter/click through a list item but scrolling is smoother now and behaves as anyone would expect. Anybody else having this issue?
@tolu360 What build number are you seeing the slow clicks with (build number is in the last four digits in this line at the top of the js, like Ionic, v1.0.0-beta.1-nightly-1553)?
How large of a list do you have? Are you seeing the same issues if you have just 3 items? Reason I ask is just to figure out if its a list performance issue or a tap/click delay issue. Thanks
My most recent compiled version of the app runs on nightly 1520. This bit of a lag is not apparent on Android versions 4.2 and above but then I can’t even generalize because I only tested on just one 4.1.2 device.
My list is around 25 items right now. Haven’t tested on a real device with fewer list items though.