user3066095
user3066095

Reputation: 15

Overflow on UI-sortable and knockout. Dragged element disappears

I have a strange behavior by using UI-sortable and knockout: on dragging one "report item" to target, once the dragged element leaves the container "Reports", it can not be seen. See fiddle. That happens when I'm adding

overflow-y:scroll; 

on the style .metro-section-reports. Without overflow it working fine.

Anyone could help me with the problem?

Thank a lot.

Upvotes: 0

Views: 481

Answers (1)

Hans Roerdinkholder
Hans Roerdinkholder

Reputation: 3000

http://jsfiddle.net/wrHW5/7/

The dragged element is not able to leave the parent anymore because of the overflow setting. What I did was add the following in your sortable binding:

options: { helper: 'clone', appendTo: 'body' }

As is probably obvious, it generates a copy of the dragged element, appends it to the body, and uses that for dragging.

See http://api.jqueryui.com/draggable/#option-helper for more details

Upvotes: 1

Related Questions