                 JSON.stringify(completion.payload) +
                   "'>"+completion.text+"</li>")
             li.on('click', (e) =>
+              $("##{@listEl.attr('id')} li").removeClass('selected')
+              li.addClass('selected')
               @submit(e)
             )
             @listEl.append(li)

    @emit('submit', {el: $("##{@listEl.attr('id')} li.selected").first(), payload: @payload})
    $("##{@listEl.attr('id')} li.selected").first().addClass("current")
    e.preventDefault()
    #@inputEl.focus()


  getAutoCompleteResults: (q) ->
    params = '{"' +

      switch keycode
        when 9 # Tab
          @submit(e)
    )

  submit: (e) ->
