       throw new Error 'Invalid parent group' if parentGroupElement.tagName != 'LI' or ! parentGroupElement.classList.contains 'group'
       parentGroupElement = parentGroupElement.nextSibling
     else
-      parentGroupElement = @treeRoot
+      parentGroupElement = @_treeRoot
 
     element.classList.add type
     element.draggable = true

        'inside'

  _onDragOver: (event) =>
    return false if ! @draggedItem?
    dropInfo = @_getDropInfo event

    # Prevent dropping onto null or descendant
    return false if ! dropInfo?
    return false if @draggedItem.classList.contains('group') and @draggedItem.nextSibling.contains(dropInfo.target)

    @_clearDropClasses()
    dropInfo.target.classList.add "drop-#{dropInfo.where}"
    event.preventDefault()

  _clearDropClasses: ->
    @treeRoot.querySelector('.drop-above')?.classList.remove('drop-above')
    @treeRoot.querySelector('.drop-inside')?.classList.remove('drop-inside')
    @treeRoot.querySelector('.drop-below')?.classList.remove('drop-below')
    return

  _onDragLeave: (event) =>

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

    if @selectedItems.indexOf(event.target) == -1
      @clearSelection()
      @addToSelection event.target

    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
