#4838 closed bug (fixed)
containment: 'document' is incorrect for top and left in draggable
Reported by: | Lino | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.8.14 |
Component: | ui.draggable | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
In draggable when using {containment: 'document'}, the dragged element can be moved out of the page to the left and to the top.
I see this with jQuery UI 1.7.2 and also with the current SVN trunk, using Firefox 3.5.2.
Wild guess: this may be a side effect of changeset 211.
A simple example that demonstrates this problem:
<html> <head> <script src="jquery-1.3.2.min.js"></script> <script src="ui.core.js"></script> <script src="ui.draggable.js"></script> </head> <body> <p> Insert some space from the top of the page. </p> <p> <span style="background: red; color: white;">Drag me</span> </p> <script> $('span').draggable({containment: 'document'}); </script> </body> </html>
Change History (4)
comment:1 Changed 13 years ago by
Milestone: | TBD → 1.8 |
---|
comment:2 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 Changed 12 years ago by
Draggable: Changed logic to only subtract left and top offsets of containment if left and top are not already 0. Fixed #4838 - containment: 'document' is incorrect for top and left in draggable (cherry picked from commit 6e6d0b749c4724955a88a0a53ae1378391991064)
Changeset: 18669056957c49d5b72693a1d61d47f041d6e5ff
comment:4 Changed 12 years ago by
Milestone: | 1.9 → 1.8.14 |
---|
Note: See
TracTickets for help on using
tickets.
Merge pull request #266 from kborchers/bug_4838
Draggable: Changed logic to only subtract left and top offsets of containment if left and top are not already 0. Fixed #4838 - containment: 'document' is incorrect for top and left in draggable