hidden widgets do not get a label anymore

master
Josha von Gizycki 6 years ago
parent c37f3aec8d
commit fce6d29bdf

@ -118,7 +118,8 @@
(list (list
(when (and validate? (not (spec/valid? spec req-value))) (when (and validate? (not (spec/valid? spec req-value)))
(spec-to-errmsg label spec req-value)) (spec-to-errmsg label spec req-value))
(hform/label id label) (when-not (= :hidden widget)
(hform/label id label))
(renderer id def (if validate? req-value value))))) (renderer id def (if validate? req-value value)))))
(defn form-hash [def values] (defn form-hash [def values]

@ -190,7 +190,7 @@
(let [def {:fields {:foo-id {:label "foo-label" (let [def {:fields {:foo-id {:label "foo-label"
:widget :hidden}}}] :widget :hidden}}}]
(is (= (list nil (is (= (list nil
[:label {:for "foo-id"} "foo-label"] nil
[:input {:id "foo-id" [:input {:id "foo-id"
:type "hidden" :type "hidden"
:name "foo-id" :name "foo-id"
@ -202,7 +202,7 @@
(let [def {:fields {:foo-id {:label "foo-label" (let [def {:fields {:foo-id {:label "foo-label"
:widget :hidden}}}] :widget :hidden}}}]
(is (= (list nil (is (= (list nil
[:label {:for "foo-id"} "foo-label"] nil
[:input {:id "foo-id" [:input {:id "foo-id"
:type "hidden" :type "hidden"
:name "foo-id" :name "foo-id"

Loading…
Cancel
Save