Sortables on nested lists break #1162

Speedrockracer opened this Issue Nov 13, 2012 · 1 comment


None yet
2 participants


I use the sortables plugin for a project to order a menu.
The list is build something like this:

  • menu item1
  • menu item2
    • submenuitem1
    • submenuitem2
  • menu item3
    • submenuitem1
    • submenuitem2

The plugin wont allow me to drag a menu item from a nested list to the main list or to a other sub list. I if add all the sublists with the addLists() function.
I made a quick fix in the addItems() function of the sortables class.

addItems: function(){
            var start = element.retrieve('sortables:start', function(event){
                                if('li') == element) // mod to allow nested lists
                          , event, element);

            (this.options.handle ? element.getElement(this.options.handle) || element : element).addEvent('mousedown', start);
        }, this);
        return this;

This stops the click event if it is in a submenu so the right menu item is dragged. However I still have the issue of moving from one sublist to the other. First time posting a bug so I hope I did it right.



arian commented Nov 13, 2012

Sortables isn't designed to work with nested lists...

@arian arian closed this Nov 13, 2012

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