fix: don't create block for invalid number property value

This commit is contained in:
Tienson Qin
2025-05-21 20:28:18 +08:00
parent 54772d861d
commit 17496cfbb1
2 changed files with 6 additions and 4 deletions

View File

@@ -251,9 +251,9 @@
(= :logseq.property/empty-placeholder (:db/ident (d/entity @conn v))))))) (= :logseq.property/empty-placeholder (:db/ident (d/entity @conn v)))))))
v v
;; only value-ref-property types should call this ;; only value-ref-property types should call this
(let [v' (if (and number-property? (string? v)) (when-let [v' (if (and number-property? (string? v))
(parse-double v) (parse-double v)
v)] v)]
(find-or-create-property-value conn property-id v'))))) (find-or-create-property-value conn property-id v')))))
(defn- throw-error-if-self-value (defn- throw-error-if-self-value

View File

@@ -1241,7 +1241,9 @@
(set-editing! false))))] (set-editing! false))))]
[:div.ls-number.flex.flex-1.jtrigger [:div.ls-number.flex.flex-1.jtrigger
{:ref *ref {:ref *ref
:on-click #(set-editing! true)} :on-click #(do
(state/clear-selection!)
(set-editing! true))}
(if editing? (if editing?
(shui/input (shui/input
{:ref *input-ref {:ref *input-ref