Browse Source

fix: only the icon displays in the block for a closed value

related to LOG-2871
Tienson Qin 2 years ago
parent
commit
ac41115521
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/main/frontend/components/property/value.cljs

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

@@ -469,7 +469,7 @@
       invalid-warning)))
 
 (rum/defc select-item
-  [property type value {:keys [page-cp inline-text]}]
+  [property type value {:keys [page-cp inline-text icon?]}]
   (let [closed-values? (seq (get-in property [:block/schema :values]))]
     (cond
       (contains? #{:page :date} type)
@@ -487,7 +487,12 @@
                       :hide-close-button? true} block)
 
             icon
-            (icon-component/icon icon)
+            (if icon?
+              (icon-component/icon icon)
+              [:div.flex.flex-row.items-center.gap-2
+               (icon-component/icon icon)
+               (when value'
+                 [:span value'])])
 
             (= type :number)
             [:span.number (str value')]