mirror of
https://github.com/logseq/logseq.git
synced 2026-05-05 19:36:35 +00:00
enhance: property value auto-complete
This commit is contained in:
@@ -54,7 +54,11 @@
|
||||
close-modal? true
|
||||
extract-fn :value}}]
|
||||
(let [input (::input state)
|
||||
*selected-choices (::selected-choices state)]
|
||||
*selected-choices (::selected-choices state)
|
||||
search-result (cond-> (search/fuzzy-search items @input :limit limit :extract-fn extract-fn)
|
||||
(fn? transform-fn)
|
||||
(transform-fn @input))
|
||||
input-opts' (if (fn? input-opts) (input-opts (empty? search-result)) input-opts)]
|
||||
(when (fn? tap-*input-val)
|
||||
(tap-*input-val input))
|
||||
[:div.cp__select
|
||||
@@ -69,14 +73,11 @@
|
||||
(let [v (util/evalue e)]
|
||||
(reset! input v)
|
||||
(and (fn? on-input) (on-input v))))}
|
||||
input-opts)]]
|
||||
input-opts')]]
|
||||
|
||||
[:div.item-results-wrap
|
||||
(ui/auto-complete
|
||||
(cond-> (search/fuzzy-search items @input :limit limit :extract-fn extract-fn)
|
||||
(fn? transform-fn)
|
||||
(transform-fn @input))
|
||||
|
||||
search-result
|
||||
{:item-render (or item-cp (fn [result chosen?]
|
||||
(render-item result chosen? multiple-choices? *selected-choices)))
|
||||
:class "cp__select-results"
|
||||
|
||||
Reference in New Issue
Block a user