react-tappable icon indicating copy to clipboard operation
react-tappable copied to clipboard

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

Open slorber opened this issue 10 years ago • 1 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: https://github.com/ftlabs/fastclick/commit/2a31072ca469def511f7ddbedbcaf305d37ab934

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

slorber avatar Aug 05 '15 09:08 slorber

PRs welcome...

dcousens avatar May 08 '17 01:05 dcousens