       while removedSelectedItems.length > 0
         removedSelectedItem = removedSelectedItems[removedSelectedItems.length - 1]
         @selectedItems.splice @selectedItems.indexOf(removedSelectedItem), 1
+        if @_firstSelectedItem == removedSelectedItem
+          @_firstSelectedItem = @selectedItems[0]
 
       element.parentElement.removeChild childrenElement
 

    try
      event.dataTransfer.setData 'text/plain', null

    @draggedItem = event.target
    @clearSelection()
    @addToSelection @draggedItem
    true

  _getDropInfo: (event) ->
    element = event.target

    return { target: element.lastChild, where: 'below' } if element == @treeRoot

    while element.tagName != 'LI' or (! element.classList.contains('item') and ! element.classList.contains('group'))
      return null if element == @treeRoot
      element = element.parentElement

    where = @_getInsertionPoint element, event.pageY


        elements.push child if inside

      @clearSelection()
      @selectedItems = elements
      @_firstSelectedItem = startElement
      selectedItem.classList.add 'selected' for selectedItem in @selectedItems
    else
      @addToSelection element
