 (defn search-component
   "renders the search input box"
   [props]
-  (let [chan-query (chan) ;; sampled text term that is used for ajax wiki API calls
+  (let [chan-current-suggestion (chan 1)
+        chan-query (chan) ;; sampled text term that is used for ajax wiki API calls
         chan-textvalue (chan) ;; channel to hold text value from input box
         chan-keys (chan) ;; channel to store individual keys to respond to keys like return and tab
         chan-sampler (chan (sliding-buffer 1)) ;; channel used to hold current value of text; since this buffer is of size 1, only the most recent value is stored in this channel

;;; autocomplete panel
(defn- autocomplete-item
  "renders a single autocomplete item in list"
  [chan-selecteditems chan-focus item focus-item]
  [:li
   [:a {
        :href ""
        :on-click #(put! chan-selecteditems item)}

           [:ul.dropdown-menu
            {:role "menu"}
            (for [item (take size @itemsref)]
              ^{:key (utils/uuid)} [autocomplete-item chan-selecteditems chan-current-suggestion item ref-focus-item])]])
        [:div.close]))))

;;; search input box and component
