Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Sole items are dragged above itemPath #56

tommedema opened this Issue Dec 6, 2013 · 6 comments


None yet
2 participants

This issue is stopping my sortable list from functioning properly.

Steps to reproduce:

  1. visit simplified version at http://jsfiddle.net/hE8pD/42/
  2. drag the single node (item 1A) and release it at the same location
  3. note that the element is not dragged to its original location in the panel-body element (as stipulated by itemPath), but rather to the parent element .menu-category (which is set as the containorSelector).

Strangely enough, when you add 2 elements instead of 1, this problem does not appear. Please repeat the steps above with http://jsfiddle.net/hE8pD/43/ and notice that here the issue is not present! Seems like an obvious bug to me.

Do you have any idea on how to resolve this?

I actually thought that the containerPath option would solve this, but it doesn't seem to help. Do you have any suggestions on how to resolve this?


johnny commented Dec 8, 2013

I know where this problem lies, how the special case is handled. The problem lies in this line

rootGroup.movePlaceholder(this, this.el, "append")

The Item is appended without the namespace itemPath, which is the path from the container to the item.

If you want to give it a try...

It's certainly related to that line. Changing it to rootGroup.movePlaceholder(0, pointer) resolves the problem but then a new issue is created where items cannot be put into empty subcontainers. You can test it at http://jsfiddle.net/hE8pD/44/

I don't really understand what movePlacer holder, so it's hard for me to debug.

@johnny could you give a short description of that movePlaceholder function? Perhaps then it will make more sense to me what is going wrong here.

Your plugin seems to be the best one available for creating a sortable list, just need to iron out some of these bugs

@johnny johnny closed this in d1a5f85 Dec 13, 2013


johnny commented Dec 13, 2013

I added a quick fix to solve your problem (not a dry solution). Thank you for finding this bug.

Lets see what you turn up next :)

Excellent, thanks for the quick solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment