       @hideResults()
 
       @_val = @element.val() # to keep track of what WAS in the text box
+      @oldQuery = @_val
 
       @queryResultArea.on 'mousedown', 'li.choice', ->
         value = $(@).data 'value'

          when 40 # down
            e.preventDefault() # prevent cursor from moving
            @highlightNextChoice()

    # @element.on 'blur'
    # revert or set to null after losing focus

      query = @element.val()
      if @_val isnt query # user has changed input value, do a search and display the search results
        @_val = query
        @oldQuery = query
        if query is ''
          @hideResults()
        else
          @insertFilteredChoiceElements query

    # @element.on 'keydown'
    # select the highlighted choice
