Opened 6 years ago

Closed 5 years ago

#9608 closed bug (worksforme)

Draggable: nested draggables can't be dragged

Reported by: mohini Owned by:
Priority: minor Milestone: none
Component: ui.draggable Version: 1.10.1
Keywords: Cc:
Blocked by: Blocking:

Description

When I start drag on an li item which is sub item of "LI"element. It is considering the whole element. Like in over callback function it is giving the target element as parent li element. I have created a fiddle and wrote some console statements.

http://jsfiddle.net/3QMzh/44/. When we move subfolder1, it is higlighting the parent li element not removing the highlight for the subfolder1. So the event.target element is giving the parent element "Deleted"

Change History (3)

comment:1 Changed 6 years ago by tj.vantoll

Hi mohini,

Thanks for taking the time to contribute to the jQuery UI project. Droppable supports overlapping drop zones but I don't believe it supports parent/child drop zones, for example:

<ul>
  <li>One
    <ul><li>Two</li>
  </li>
</ul>
<script>
  $( "li" ).droppable({ … });
</script>

Can someone else on the team confirm that for me?

comment:2 Changed 6 years ago by mikesherov

Component: ui.droppableui.draggable
Milestone: none2.0.0
Status: newopen
Summary: Target droppable element is shown as parent elementDraggable: nested draggables can't be dragged

This is actually an issue with draggable. If you drag one of the other items to subfolder1, it's recognized as a drop zone. It's the fact that you can't actually drag subfolder1 that's the problem. mohini's code does the "wrong thing" to try to illustrate a problem with droppable.

comment:3 Changed 5 years ago by mikesherov

Milestone: 2.0.0none
Resolution: worksforme
Status: openclosed

Actually, this is a bug in userland code:

var sourceFolder = $(ui.draggable).parent("ul").parent('li').find('a').attr('id');

should actually be:

var sourceFolder = $(ui.draggable).parent("ul").find('li').find('a').attr('id');
Note: See TracTickets for help on using tickets.