aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt2020-07-30 17:23:24 +0200
committerJasper Van der Jeugt2020-07-30 17:23:24 +0200
commitfe56ddfbd14b3e7fbaee8732641bcc00fbd0c856 (patch)
tree617450f2576b1d5d6575f48c739670efc3cbbb5e
parentf4b0e4ec20cd903b7a603edfb043a21bb175b246 (diff)
Forms wtf
-rw-r--r--client/src/Client.elm22
1 files changed, 14 insertions, 8 deletions
diff --git a/client/src/Client.elm b/client/src/Client.elm
index aa2121c..1938711 100644
--- a/client/src/Client.elm
+++ b/client/src/Client.elm
@@ -51,16 +51,22 @@ view model = case model of
(\p -> Html.li [] [Html.text p])
game.view.opponents
, Html.h1 [] [Html.text "You"]
- , Html.input
- [ Html.Attributes.value game.changeMyName
- , Html.Events.onInput ChangeMyName
+ , Html.form
+ [ Html.Attributes.action ""
+ , Html.Events.onSubmit SubmitMyName
]
- []
- , Html.button
- [ Html.Events.onClick SubmitMyName
- , Html.Attributes.disabled <| game.view.myName == game.changeMyName
+ [ Html.input
+ [ Html.Attributes.value game.changeMyName
+ , Html.Events.onInput ChangeMyName
+ ]
+ []
+ , Html.button
+ [ Html.Attributes.type_ "submit"
+ , Html.Attributes.disabled <|
+ game.view.myName == game.changeMyName
+ ]
+ [Html.text "change"]
]
- [Html.text "change"]
]
subscriptions : Model -> Sub Msg