       @selection = @completions.length - 1 if @selection < @initialSelectionValue
       @updateSelection()
     else if (action == "enter")
+      # <Enter> immediately after new suggestions have been posted is ignored.  It's all too common that the
+      # user gets results they weren't intending.
+      return if @lastUpdateTime? and new Date() - @lastUpdateTime < 250 and @inputContainsASelectionRange()
+      @lastUpdateTime = null
       if @selection == -1
         query = @input.value.trim()
+        # <Enter> on an empty query is a no-op.
         return unless 0 < query.length
         # If the user types something and hits enter without selecting a completion from the list, then:
         #   - If a search URL has been provided, then use it.  This is custom search engine request.

    @completions = []
    @previousAutoSelect = null
    @previousInputValue = null
    @suppressedLeadingKeyword = null
    @selection = @initialSelectionValue
    @keywords = []

        @previousAutoSelect = null if @completions[0]?.autoSelect and @completions[0]?.forceAutoSelect
        @updateSelection()
        @addPromptedText()
        @lastUpdateTime = new Date()
        callback?()

  updateOnInput: =>
