made typeaheads less bad and turned off matching

This commit is contained in:
Bryce Covert
2021-05-13 16:59:35 -07:00
parent 4c764ed927
commit 34d723677d
4 changed files with 14 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
(ns auto-ap.views.components.vendor-dialog
(:require [re-frame.core :as re-frame]
[auto-ap.views.utils :refer [dispatch-event horizontal-field bind-field with-user with-is-admin? active-when]]
[auto-ap.views.utils :refer [dispatch-event horizontal-field bind-field with-user with-is-admin? active-when account->match-text]]
[auto-ap.views.components.address :refer [address-field]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.dropdown :refer [drop-down drop-down-contents]]
@@ -29,7 +29,7 @@
::settled
[(forms/in-form ::vendor-form)]
(fn [{:keys [data] :as form} _]
(let [vendors @(re-frame/subscribe [::subs/vendors])
#_(let [vendors @(re-frame/subscribe [::subs/vendors])
text (.toLowerCase (:name data ""))
matching-vendor (when (> (count text) 5)
(->> vendors
@@ -306,7 +306,7 @@
(fn [field client]
[typeahead-entity {:matches @(re-frame/subscribe [::subs/accounts client])
:match->text (fn [x ] (str (:numeric-code x) " - " (:name x)))
:match->text account->match-text
:field field
:type "typeahead-entity"
:event change-event