Skip to main content

Search and Top Navigation

#7610 closed bug (notabug)

Opened August 05, 2011 02:08PM UTC

Closed August 09, 2011 01:11PM UTC

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.

Attachments (0)
Change History (6)

Changed August 06, 2011 12:04AM UTC by mflerackers comment:1

_comment0: 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.1312589097445204

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.

Changed August 06, 2011 03:38PM UTC by scottgonzalez comment:2

owner: → 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.

Changed August 07, 2011 02:35AM UTC by mflerackers comment:3

_comment0: I does, just uncomment the line, or go here, where it is uncommented http://jsfiddle.net/HANq6/7/. Drag an item from the richt list to the left list, release it, now try to drag the same item again, you can't.1312684548865660
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.

Changed August 09, 2011 12:36PM UTC by scottgonzalez comment:4

status: newpending

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

Changed August 09, 2011 12:48PM UTC by mflerackers comment:5

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.

Changed August 09, 2011 01:11PM UTC by scottgonzalez comment:6

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.