Skip to content

Commit

Permalink
fix: reduce debounce time for search results
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed Sep 21, 2024
1 parent f494ef9 commit bd9b926
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/frontend/components/cmdk/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@
(handle-input-change state e)
(when-let [on-change (:on-input-change opts)]
(on-change new-value))))
150)
100)
[])]
;; use-effect [results-ordered input] to check whether the highlighted item is still in the results,
;; if not then clear that puppy out!
Expand All @@ -804,7 +804,7 @@
:on-blur (fn [_e]
(when-let [on-blur (:on-input-blur opts)]
(on-blur input)))
:on-composition-end (gfun/debounce (fn [e] (handle-input-change state e)) 150)
:on-composition-end (gfun/debounce (fn [e] (handle-input-change state e)) 100)
:on-key-down (gfun/debounce
(fn [e]
(p/let [value (.-value @input-ref)
Expand All @@ -821,7 +821,7 @@
(and backspace? (= input ""))))
(reset! (::filter state) nil)
(load-results :default state))))
150)
100)
:default-value input}]]))

(defn rand-tip
Expand Down

0 comments on commit bd9b926

Please sign in to comment.