DEV Community

Discussion on: How to continuously drag an element in React with javascript

Collapse
 
arhman profile image
Abed Alrahman Sayes

Neat code bro :)
BUT if you move mouse fast then the mouse is out of wrapper element and the onmousemove and onmouseup event listeners is not valid any more!

To avoid that issue add those listeners on the window object.

Collapse
 
roggc profile image
roggc

thanks a lot for your comment. you are totally right.