Modify ↓
Ticket #2539 (closed bug: fixed)
draggable - grid: [x,y] and containment incompatible
| Reported by: | atreyas | Owned by: | paul |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.4 |
| Component: | ui | Version: | 1.2.3 |
| Keywords: | draggable, grid, containment | Cc: | |
| Blocking: | Blocked by: |
Description
If I use the grid[x,y] property for a jQuery draggable object is not able to contain itself to a containment.
e.g.
.draggable ({
helper: 'original',
grid: [50,50],
containment: 'parent'
});
does not contain the element to the parent div tag
On the other hand, the following are working:
.draggable ({
helper: 'original',
//grid: [50,50],
containment: 'parent'
});
contains it to the div element.
Change History
comment:3 Changed 22 months ago by f.leginski@…
You saved me! I've been looking for a solution all day long. The problem was because the div's wasn't moving to their previous place (revert sux). I found out that this happened only if I've set grid option. It didn't stuck to the previous grid possition but somewhere else.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

This is fixed in the latest trunk version. However, it's not quite perfect, because at the edges, the grid is not respected. I hope this solves your issue anyway!