JedWatson / react-tappable

Tappable component for React
http://jedwatson.github.io/react-tappable/
MIT License
862 stars 90 forks source link

Better solution to block click event firing #35

Closed JedWatson closed 9 years ago

JedWatson commented 9 years ago

@jossmac and I have isolated some issues with mobile UIs behaving unexpectedly (focus stolen after tap event, and potentially weird jumping effects with CSSTransitionGroups in WKWebViews) to Tappable, we're pretty sure it is because mobile Safari is still emulating the click event 300ms after the tap event and if there's a potential handler (focus target, etc) under the coordinates that were tapped, it fires.

Tappable currently works around this by preventing double fires but we now have reason to suspect that preventing default in the onTouchEnd method is a better solution, and globally prevents the weirdness.

I'm going to turn that on there and see if we can establish it resolves the issue for good, without introducing any other side effects (this is really hard to reproduce except in real-world scenarios in an app on an iPhone)