     return if index is -1
     if item is @activeItem
       if @items.length is 1
-        @activeItem = undefined
+        @setActiveItem(undefined)
       else if index is 0
         @activateNextItem()
       else

    @emitter = new Emitter

    @items = Sequence.fromArray(compact(params?.items ? []))
    @activeItem ?= @items[0]

    @subscribe @items.onEach (item) =>
      if typeof item.on is 'function'

    @items.splice(index, 0, item)
    @emit 'item-added', item, index
    @emitter.emit 'did-add-item', {item, index}
    @setActiveItem(item) unless @getActiveItem()?
    item

  # Public: Adds the given items to the pane.
