Closed katerlouis closed 7 years ago
Lethargy doesn't work for the first 15 events or so. This is because it must hold a cache of past events to determine whether the next event is likely to be an intent or not. If you see real carefully in the demo, the first 15 events would all be green, only when the initial 15-unit cache has been filled would lethargy work properly.
For normal mouse events, because a single scroll / swipe fires 10-20 events anyways, so the cache fills up quickly. For normal mouse events, this would not be a problem because they have no inertial scroll.
Your current set up has a stability
value of 20
, which actually extends that cache to ~40 events. If you decrease that back to around 8
, it should not fire 2 events with your timeout function.
If it doesn't work, please post (screenshot) a profile of the scroll on your Macbook trackpad using this tool, similar to the image you see below:
Thank you so much. It works like a charm with stability 8. Awesome!
<3
.. no matter how long the timeout is. The issue occurs on trackpads (tested on different Macbooks)
After those initial up and down swipe it works perfectly across all tested devices.
Refreshed page: Console for inputs: "Down" > "Up" > "Down" > "Up"