From 7ec5b5601fd655643ad0fe1120d56bc9b71674f6 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 26 Jun 2016 15:01:14 +0200 Subject: Set up enter form submi behaviour on dialog --- src/client/elm/View/Form.elm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/client/elm/View') diff --git a/src/client/elm/View/Form.elm b/src/client/elm/View/Form.elm index 1522b1f..5f642fb 100644 --- a/src/client/elm/View/Form.elm +++ b/src/client/elm/View/Form.elm @@ -1,6 +1,7 @@ module View.Form exposing ( textInput , radioInputs + , hiddenSubmit ) import Html exposing (..) @@ -41,7 +42,8 @@ textInput translations form formName fieldName = [ for (formName ++ fieldName) ] [ text (Translations.getMessage (formName ++ fieldName) translations) ] , button - [ onClick (Form.Input fieldName Field.EmptyField) + [ type' "button" + , onClick (Form.Input fieldName Field.EmptyField) , tabindex -1 ] [ FontAwesome.times Color.silver 15 ] @@ -98,3 +100,11 @@ formError translations error = SmallerIntThan n -> errorElement "SmallerIntThan" [toString n] GreaterIntThan n -> errorElement "GreaterIntThan" [toString n] error -> errorElement (toString error) [] + +hiddenSubmit : msg -> Html msg +hiddenSubmit msg = + button + [ style [ ("display", "none") ] + , onClick msg + ] + [] -- cgit v1.2.3