-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PanResponder: 'move' is called before mouse is pressed #701
Comments
Yeah that shouldn't be the case. You can see the |
The difference is that the PanResponder demo doesn't request grant for mouse move, only for mouse press:
whereas in my code I want mouse move, but only after mouse press |
I see. Thanks |
I tried your demo (thanks for making one) against master. The problem looks to have been fixed by this patch - 9ee89bc. This makes the mouse work like touch in the responder system - press and drag is a move. The fix should be in the next release. Thanks again |
Exclude middle, wheel, and right click mouse events from the responder system. This fixes the Touchables incorrectly triggering 'onPress' in response to these events. Filter mousemove events in the 'extractEvents' methods, and check for active touches rather than the length of the touch bank. This fixes the PanResponder not functioning after the first touch in Firefox. Fix #719 Fix #729 Close #804
I believe this is a bug
I have a carousel style component where the responder should be granted when the user presses and drags for at least 50px horizontally. It shouldn't be granted on press because it can be contained in a vertical scrollview, and also it should let buttons be pressed inside.
In react-native I can use
onMoveShouldSetPanResponder: (evt, g) => Math.abs(g.dx) > 50,
.On mobile it's impossible to cause a move before a start due to using touches, but using a mouse pointer things are different.
I think in react native web the PanResponder shouldn't grant move until the mouse has been pressed, in order to mirror how touch events works. Otherwise doing what I want doesn't seem possible.
Glitch example:
https://glitch.com/edit/#!/bold-bit?path=src/App/index.js
As you can see the responder gets granted as soon as you move over the red box
The text was updated successfully, but these errors were encountered: