[TIMOB-7740] iOS: Add a parameter to addEventListener for scrollEnd listener
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-08-08T15:49:41.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | process |
Assignee | Neeraj Gupta |
Created | 2012-02-03T08:14:10.000+0000 |
Updated | 2017-03-24T18:22:53.000+0000 |
Description
It would be useful to create a parameter for adjusting scrollend event like this :
myscrollview.addEventListener('scrollend', callbackfunction, seconds)
Thus, the parameter *seconds* would be the number of seconds before thescrollview stops.
At this time, the callback function would be called.
Going to mark this one as invalid, and offer dragend instead, which triggers on the user lifting up their finger, before the scroll view slows to a stop. The reason this wouldn't work is because at best it would be inconsistent, at worst it would be fully wrong. For one, if there's a scroll that's not animated, there's no way to fire off except after the fact. Okay, let's limit it to user-driven events. Suppose we do properly reverse engineer Apple's inertial scrolling algorithm. And that Apple doesn't tweak it from OS to OS. If you scroll, stop, then lift your finger, the time left of scrolling is 0, making the event listener be late as if it were not animated. Perhaps only when the finger is up and the scroll view is decelerating. Even then, the clairvoyant event listener would be wrong. Many users, when scrolling a large list, will swipe up or down multiple times to keep scrolling. As such, if the event listener wants to fire 0.5s before the end of scrolling, and we properly predict that the scrolling will stop in 0.5s, the event listener fires. But it would be erroneous, because the user's finger lands and continues the scroll 0.4s before the scroll ends, meaning the scroll handler fired on a nonexistent situation. It is for this reason that this functionality cannot be done.
Closing ticket as invalid with reference to the above comments.