zilverline / react-tap-event-plugin

Instant TapEvents for React
http://facebook.github.io/react/
MIT License
1.07k stars 110 forks source link

Unnatural behavior when mouse moved more than 10px during click #26

Closed fatfisz closed 7 years ago

fatfisz commented 9 years ago

I was clicking a bit to see how the UI of my little React project feels and noticed that touchTap wasn't firing half of the time. The cause seems to be this line:

if (isEndish(topLevelType) && distance < tapMoveThreshold) {

The distance check is performed for both touch events and mouse events, but for mouse it is inconsistent with the natural behavior. Let's say there is a 100px wide element; user pushes the mouse button on the left side of the element and releases it on the right side. The element should receive a click event - and also a touchTap event, I assume.

I can fix this if it is considered a valid issue.

s0meone commented 9 years ago

You are right, whenever a mouse event is happening, the tapMoveTreshold should probably be ignored.

fatfisz commented 9 years ago

I'll be looking at this in a couple of days then if my plans work out.

fatfisz commented 7 years ago

Closing this, as it's been inactive for quite some time. Sorry I didn't work on that as I wrote :( It seems that I moved on to other things since the time I opened this issue.