Просмотр исходного кода

fix: reduce debounce time for search results

Tienson Qin 1 год назад
Родитель
Сommit
bd9b9266b4
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      src/main/frontend/components/cmdk/core.cljs

+ 3 - 3
src/main/frontend/components/cmdk/core.cljs

@@ -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!
@@ -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)
@@ -821,7 +821,7 @@
                                         (and backspace? (= input ""))))
                            (reset! (::filter state) nil)
                            (load-results :default state))))
-                     150)
+                     100)
        :default-value input}]]))
 
 (defn rand-tip