From 9d3c32956baab4dc4e1fd114e586b48d850a14c9 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Tue, 4 Jun 2024 09:59:10 +0200 Subject: show form input --- frontend/app/Form/Internal.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'frontend/app/Form/Internal.hs') diff --git a/frontend/app/Form/Internal.hs b/frontend/app/Form/Internal.hs index 7782368..8c9935f 100644 --- a/frontend/app/Form/Internal.hs +++ b/frontend/app/Form/Internal.hs @@ -53,8 +53,7 @@ mapValues get set (Form {view, fill}) = } runForm :: Form i o -> i -> View (Either i o) -runForm (Form {view}) i = - div_ [] $ - (fmap Left <$> view i) - <> [ button_ [type_ "submit"] [text "submit"] - ] +runForm form i = + form_ [onSubmit (either (\_ -> Left i) (Right) (form.fill i))] $ + (fmap Left <$> form.view i) + <> [button_ [type_ "submit"] [text "submit"]] -- cgit v1.2.3