     (recur)))
 
 (defn- make-typeahead-state
-  [{:as args :keys [on-change rigid? data-source]}]
+  [{:as args :keys [on-change rigid? change-on-blur? data-source]}]
   (let [c-input (chan)]
     (assoc typeahead-state-initial
-           :data-source data-source     ;; FIXME does not work yet ... need to make it test in render if this value has changed since last render
+           :data-source data-source
+           :change-on-blur? change-on-blur?
            :on-change  on-change
            :rigid?     rigid?
            :c-input    c-input


    selected-index
    (choice-made (let [[_ suggestion] (nth suggestions selected-index)] suggestion))))

(defn- select-reset
  [state]

  (swap! state-atom assoc :waiting? true))

(defn- handle-search
  [state-atom c-sugg c-search]
  (go-loop []
    (let [new-text (<! c-search)
          data-source (:data-source @state-atom)]
      (if (= "" new-text)
        (swap! state-atom reset-typeahead)
        (search-data-source data-source state-atom c-sugg new-text))
