         on-input-fn #(update-search-fn (h/parse-search (.. % -target -innerText)))
 
         ; find incomplete tag or mention before cursor, show suggestions
-        before-cursor (h/string-before-cursor (:search-text (:current-query @local)))
+        before-cursor (h/string-before-cursor (:search-text (:temp-query @local)))
         [curr-tag f-tags] (h/autocomplete-tags before-cursor "#" hashtags)
         [curr-mention f-mentions] (h/autocomplete-tags before-cursor "@" mentions)
         tag-replace-fn (fn [curr-tag tag]
                          (let [curr-tag-regex (js/RegExp (str curr-tag "(?!" h/tag-char-class ")") "i")
-                               search-text (:search-text (:current-query @local))]
-                           (update-search-fn (h/parse-search (s/replace search-text curr-tag-regex tag)))))
+                               search-text (:search-text (:temp-query @local))
+                               new-search (h/parse-search (s/replace search-text curr-tag-regex tag))]
+                           (swap! local assoc-in [:current-query] new-search)
+                           (update-search-fn new-search)))
         get-tags #(% (:current-query @local))
         on-keydown-fn (fn [ev]
                         (let [key-code (.. ev -keyCode)]

                                           #(aset js/window "location" "hash" (js/encodeURIComponent search-text))
                                           5000))
        update-search-fn (fn [new-search]
                           (swap! local assoc-in [:current-query] new-search)
                           (swap! local update-in [:set-location]
                                  (fn [prev] (when prev (.clearTimeout js/window prev))
                                    (location-timeout-fn (:search-text new-search))))

                              (tag-replace-fn curr-tag (first f-tags)))
                            (when (and curr-mention (seq f-mentions))
                              (tag-replace-fn curr-mention (first f-mentions)))
                            (.setTimeout js/window (fn [] (u/focus-on-end (.-target ev))) 50)
                            (.preventDefault ev))))]
    [:div.search
     [:div.hashtags
