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

fix: select options order changed when choosing values

Tienson Qin 4 месяцев назад
Родитель
Сommit
eb2ae991b3
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      src/main/frontend/components/property/value.cljs

+ 2 - 1
src/main/frontend/components/property/value.cljs

@@ -653,7 +653,8 @@
                (f chosen selected?)))]
                (f chosen selected?)))]
     (hooks/use-effect!
     (hooks/use-effect!
      (fn []
      (fn []
-       (set-items! (sort-select-items property selected-choices items)))
+       (when-not (= (count items) (count sorted-items))
+         (set-items! (sort-select-items property selected-choices items))))
      [items])
      [items])
     (select/select (assoc opts
     (select/select (assoc opts
                           :selected-choices selected-choices
                           :selected-choices selected-choices