Skip to content


Browse files Browse the repository at this point in the history
Fix gift list form UX.
  • Loading branch information
codonnell committed Jul 4, 2020
1 parent bf0be73 commit 2cbd20b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/rocks/mygiftlist/ui/gift_list.cljs
Expand Up @@ -32,23 +32,26 @@
(let [validity (fs/get-spec-validity gift-list ::gift-list/name)]
{:onSubmit (fn [_]
(if-not (= :valid validity)
(comp/transact! this [(fs/mark-complete! {})])
(if (= :valid validity)
(comp/transact! this
(select-keys gift-list
[::gift-list/id ::gift-list/name]))])
(comp/transact! this
[(fs/mark-complete! {})])))}
{:placeholder "Birthday 2020"
:onChange (fn [evt]
(when (= :unchecked validity)
(comp/transact! this
{:field ::gift-list/name})]))
(m/set-string! this ::gift-list/name :event evt))
:onBlur (fn [_]
(comp/transact! this
[(fs/mark-complete! {:field ::gift-list/name})]))
:error (when (= :invalid validity)
"Gift list name cannot be blank")
:autoFocus true
:fluid true
:value name})
Expand Down

0 comments on commit 2cbd20b

Please sign in to comment.