title: jQuery UI sortable and draggable. Getting the index of dragged element
body: <p>I am having a very specific problem, using jQuery UI sortable and dragable together. I want to be able to get the index/placement in the list of the newly dragged element. I am able to get this if I move the elements around inside the list.</p>
  
  <pre><code>$("#draggable").draggable({
      cursor: "move",
      helper: "clone",
      connectToSortable: ".sortable"
  });
  $( ".sortable" ).sortable({
      items: 'li',
      stop: function(event, ui) {
          index = ui.item.index()+1;
          console.lo(index);
      },
      connectWith: ".sortableSub",
      appendTo: 'body',
  }).disableSelection();
  </code></pre>
  
  <p>The code above works as it should, but if i do the same with the dragged element.</p>
  
  <pre><code>receive: function(event, ui) {
      console.log(ui.item.index());
  },
  </code></pre>
  
  <p>using ui.item.index just returns 0, if i do the same in stop: instead of receive: it returns -1 instead, and this is no matter where it is dropped.</p>