DEV Community

Discussion on: Vanilla JavaScript draggable Mr Potato Head 🥔

Collapse
 
anuraghazra profile image
Anurag Hazra • Edited

Nice, but there is a bug where if you drag & move the mouse fast, and if the mouse goes outside the bounding box of the draggable element the dragging behaviour breaks.

We can fix this by attaching mousemove listeners to the window itself. and tracking the which element is begin dragging.

Collapse
 
dailydevtips1 profile image
Chris Bongers

Oh nice addition, did note this, while posting this morning. Gonna have a look at the fix