Skip to content
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

Drag binding issue on two mouse buttons pressed at the same time #11

Closed
AlexScheauaStefanini opened this issue Jun 11, 2019 · 3 comments

Comments

@AlexScheauaStefanini
Copy link

AlexScheauaStefanini commented Jun 11, 2019

This bug occurs when you drag an element (mouse leftclick is down) and you also right click.
It basically binds the element to the pointer via a mousemove event.

I found a fix for this:
In dist/displace.js on line 302 i added this if statement:

events.mousemove = mousemove.bind(this, wOff, hOff);

if(e && e.button === 0)
events.mousemove = mousemove.bind(this, wOff, hOff);

it basically binds the mousemove event only if the event is triggered by the leftclick.

@catc
Copy link
Owner

catc commented Jun 11, 2019

Can you check this works across browsers (firefox + safari + chrome) and submit a PR?

@AlexScheauaStefanini
Copy link
Author

I checked this in edge chrome firefox and safari. It works well. Just created a PR.

@catc
Copy link
Owner

catc commented Jun 18, 2019

Fixed: 2df8fff

@catc catc closed this as completed Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants