Merge branch 'master' into datomic

This commit is contained in:
Bryce Covert
2018-08-16 23:04:50 -07:00
7 changed files with 161 additions and 15 deletions

View File

@@ -18,9 +18,10 @@
]
(r/create-class
{:reagent-render (fn [{:keys [matches on-change field text-field value class not-found-description]}]
(let [text @text
valid-matches (take 5 (for [[[id t :as match] i] (map vector matches (range))
:when (str/includes? (.toLowerCase t) (.toLowerCase text))]
:when (str/includes? (or (some-> t .toLowerCase) "") (or (some-> text .toLowerCase) ""))]
match))
valid-matches (if (and not-found-description text)
(concat valid-matches [[:not-found (not-found-description text) (not-found-value text)]])
@@ -68,6 +69,7 @@
false)
true))
:on-change (fn [e]
(println valid-matches)
(reset! highlighted (ffirst valid-matches))
(select [nil (.. e -target -value)]))}
])