chrisbateman / impetus

Agnostic utility for adding momentum to anything. It's like iScroll, except not for scrolling. Supports mouse and touch events.
chrisbateman.github.io/impetus
MIT License
487 stars 70 forks source link

Right click on an element causes impetus to "stick" #54

Open jexe opened 4 years ago

jexe commented 4 years ago

Right-clicking on an object causes impetus to start tracking the mouse movement and sending event updates. It does not stop tracking this until the user left clicks again.

To repro:

What I expect is that the source doesn't receive event updates

What I experience, however, is impetus continues to send tracking events until the user left clicks and releases the mouse button again.

jexe commented 4 years ago

Should note that this is 100% repeatable in Chrome v83

jexe commented 4 years ago

It seems that you can work around this issue by pausing and resuming impetus when right click is detected:

$("#my-element").on("contextmenu", function (e) {
  impetus.pause();
  impetus.resume();
})