JedWatson / react-tappable

Tappable component for React

Home Page:http://jedwatson.github.io/react-tappable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

onTap should not be triggered when tap occurs to stop momentum scrolling

slorber opened this issue · comments

When an user is scrolling on a mobile there's "momentum scrolling" effect that makes the content continue to scroll even after the touchend event, according to the movement velocity (also called "fling scroll")

Often, the user may want to stop that momentum scrolling by tapping the screen. He does not care what he taps on, he just want to stop scrolling. But unfortunatly when the scrollable content has a lot of onTap listeners, the probability to trigger one of them is high and the user ends up opening unintentionally new popups / menus / content...

Other references on this issue here:
http://stackoverflow.com/questions/27040241/detect-if-a-touchstart-touchend-has-cancelled-a-scroll-momentum-scroll
http://stackoverflow.com/questions/10573080/mobile-safari-vertical-scrolling-how-to-detect-when-the-window-has-stopped-mov

It seems a workaroud has been implemented for FastClick#42
and the commit is here:
ftlabs/fastclick@2a31072

I may have time to work on this as we need it at at work some point, just tell me if you agree with the idea

PRs welcome...