                               (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))) 0)
+                            (.setTimeout js/window (fn [] (u/focus-on-end (.-target ev))) 50)
                             (.preventDefault ev))))]
     [:div.search
      [:div.hashtags

        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)))
        [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)))))
        get-tags #(% (:current-query @local))
        on-keydown-fn (fn [ev]
                        (let [key-code (.. ev -keyCode)]

  the latest query on change, plus sends query to backend."
  [{:keys [local put-fn]}]
  (let [hash-change-fn #(let [new-query (h/query-from-search-hash)]
                         (when (not= new-query (:temp-query @local))
                           (swap! local assoc-in [:current-query] new-query)
                           (put-fn [:state/get new-query])))]
    (aset js/window "onhashchange" hash-change-fn)
