ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.03k stars 1.2k forks source link

bind drag events to $document #353

Closed hrosenbauer closed 10 years ago

hrosenbauer commented 10 years ago

$body won't receive mouseup if the cursor is outside the browser window, $document does

Steps to repeat:

Fix: bind the mouse-events to the document so it will receive the mouseup even if the cursor is outside the browser window - this creates a more native drag-n-drop feeling.

justinwoo commented 10 years ago

You can also reproduce the issue by dragging down fast enough to escape the document.body area. If your document.body isn't big enough of an area to capture the mouse events, you end up the cursor location being lost because it isn't inside the body.

example

hrosenbauer commented 10 years ago

Pullrequest was merged in dd6c7420087d5810a9f6b02bf9d81a04a60ae840