Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery: problem with sortable items: can't be dropped onto empty lists

Here is an example double list thing: http://jsfiddle.net/xhdUW/

If one of the parent lists already has content, the list items will transfer between the parent lists easily. But if one of the parent lists is empty, the list items will not go into the empty parent list.

The docs on .sortable say that transferring to empty lists should be enabled by default: http://jqueryui.com/demos/sortable/#empty-lists , though, even when I specify dropOnEmpty: true, I get the same behavior.

like image 691
NullVoxPopuli Avatar asked Jul 26 '11 15:07

NullVoxPopuli


2 Answers

Your empty list have no height and no vertical padding. Try to add something from list:
padding-top
padding-bottom
min-height

like image 106
hadvig Avatar answered Sep 20 '22 12:09

hadvig


You have heavily abused the sortable API. See http://jsfiddle.net/6xkQE/ how it gets done right.

  1. You have to use connectWith with what you want to connect!

  2. As @hadvig mentioned, you have to set min-height!

like image 36
marc Avatar answered Sep 22 '22 12:09

marc