Opened 8 years ago

Closed 8 years ago

#7610 closed bug (notabug)

Calling .draggable({ refreshPositions: true }); on sortable items gets them stuck

Reported by: mflerackers Owned by: mflerackers
Priority: minor Milestone: 1.9.0
Component: ui.sortable Version: 1.8.15
Keywords: Cc:
Blocked by: Blocking:

Description

I create a number of droppables when hovering on other droppables (insert positions) and need to make sure the positions are refreshed as otherwise they are not recognized. This works fine for draggables, but for items from a sortable it fails. Calling .draggable({ refreshPositions: true }); on them makes them fixed inside the sortable, not calling it makes them ignore the new droppables.

Change History (6)

comment:1 Changed 8 years ago by mflerackers

See http://jsfiddle.net/HANq6/6/

What I noticed in jsfiddle is that if you try to leave the view frame with the item, it suddenly detects the changes made in the DOM.

Last edited 8 years ago by mflerackers (previous) (diff)

comment:2 Changed 8 years ago by Scott González

Owner: set to mflerackers
Status: newpending

What do you mean by "gets them stuck" and "fixed inside the sortable"? Your demo code doesn't even line up with your description of the problem.

comment:3 Changed 8 years ago by mflerackers

Status: pendingnew

I does, just uncomment the line, or go here, where it is uncommented http://jsfiddle.net/HANq6/7/. Drag an item from the right list to the left list, release it, now try to drag the same item again, you can't.

Last edited 8 years ago by mflerackers (previous) (diff)

comment:4 Changed 8 years ago by Scott González

Status: newpending

I'm extremely confused by what you're trying to accomplish. What do you expect a draggable and sortable element to do?

comment:5 Changed 8 years ago by mflerackers

Status: pendingnew

The situation is as follows: On the left side are slots, some are empty, some are not. Since you need to be able to fill empty slots, replace them and insert in between them, I use a list of droppables, with the non-empty ones also draggable. On the right is a repository of currently unused items. These need to be able to fill empty slots, swap with filled slots and be inserted between slots. For this I used a sortable as a container of items. Everything works but one thing: Dragging elements from the sortable between the slots. This is because once they hover above a slot, two new temporary slots appear above and below, but since the item doesn't see this (sortables unlike draggables don't have a refreshPositions property) it doesn't work. This is why I tried using draggable({refreshPositions:true}) on them, but then they just get stuck.

comment:6 Changed 8 years ago by Scott González

Resolution: invalid
Status: newclosed

I'm going to close this as invalid, since what you want is to refresh the positions for the sortable. Making an element both draggable and sortable doesn't make sense.

Note: See TracTickets for help on using tickets.