Intermittent momentum bounce-back artifacts on slow scrolls only

27 views
Skip to first unread message

Steve Bohrer

unread,
Mar 29, 2014, 2:53:08 PM3/29/14
to isc...@googlegroups.com
Sorry for the long explanation, but I'm having an annoying intermittent issue, rather than one that happens always, so I thought the context might be necessary. I'm hoping for clues from those who have a deeper understanding of iScroll momentum and bounce.

I'm using iScroll 5 for a single vertical UL list, set to snap to the LIs. List shows a standard, non-interactive scroll bar, and I use a tap event handler for the user to select items in the list, but I don't use any of the other scroll events. I use the default bounce, momentum, and ease settings.

The top half of the portrait screen is a scrolling list of data collection locations, typically about 30 to 60 of them, and on our usual Android tablets, the list area fits about 10 of them. The bottom half of the screen has data entry controls for the item selected in the top list. (Note that the user can freely scroll through the top list, and the bottom area is changed only when they tap to select a different area.)

This all works, mostly. "Flicking" up or down will scroll to the end of the list, as expected, and slower scrolling (which feels like dragging the list up or down) to a specific item usually works also. But, sometimes, after a slow scroll to a particular item, the list bounces back to near the starting position after the scroll. E.g. if the top of the list initially shows the 1st item, and you drag down so the 9th item is at top, often it works. But occasionally, it will bounce-back after I lift my thumb to showing the second or third item at the top.

I can also make this happen sometimes testing my app with a mouse on Chrome on my desktop, but have not been able to figure a way for a break point only in the cases when the bug occurs. So far, if I trap on every end scroll, I've not seen the bug.

(Since snap is on, iScroll "corrects" the final position to the top of an LI element, but that does not really seem to be a factor here.)

The scroll bar on the right properly indicates what is happening: it moves along with the list during the scroll, and when a "drag to position" works, the scroll bar just stays put at the end of the scroll. But when the bug happens, the scroll bar snaps back up almost to the starting position.

Seems it must be some interaction with momentum and bounce, but I can't really pin down the case that triggers it. Sometimes it seems I can reproduce it again and again, and sometimes I can only rarely make it happen. Perhaps its an extra bit of push as I lift my finger? Interaction at the edge of the scroll area?

Any hints where I might look? Debugging suggestions to narrow it down? OR, if you need to see code or need more complete explanation, please mention that also.

Thanks,
Steve
Reply all
Reply to author
Forward
Message has been deleted
0 new messages