     @$el.removeClass("disabled").find("input.typeahead").prop "disabled", false
 
   autoCompleteCurrentValue: ->
-    searchValue = @$("input.typeahead").val()
+    searchValue = @model.get('text')
     @_auto_completes_view.search_collection.searchFor searchValue

    @_auto_completes_view = new AutoCompletesView
      mainView: this
      alreadyAdded: @collection
    @_text_input_view = new TextInputView()

    @_text_input_view.on 'return', => @addCurrentlySelectedChannel()
    @_text_input_view.on 'down', => @_auto_completes_view.moveSelectionDown()

      e.preventDefault()
      e.stopPropagation()

  autoCompleteCurrentValue: ->
    searchValue = @$("input.typeahead").val()
    @model.set(text: searchValue)


class window.AutoCompletedAddToChannelView extends Backbone.Marionette.Layout
  tagName: "div"
  className: "add-to-channel"
  events:
    "click div.auto_complete": "addCurrentlySelectedChannel"

  regions:
