aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/View/Form.elm
diff options
context:
space:
mode:
authorJoris2016-06-26 15:01:14 +0200
committerJoris2016-06-26 15:01:14 +0200
commit7ec5b5601fd655643ad0fe1120d56bc9b71674f6 (patch)
tree48dfdb9139cb2d0befdb69595dffdf8462c86b6f /src/client/elm/View/Form.elm
parent27bf42c165e5a9fa242e0679fca621f2a6dc4adb (diff)
downloadbudget-7ec5b5601fd655643ad0fe1120d56bc9b71674f6.tar.gz
budget-7ec5b5601fd655643ad0fe1120d56bc9b71674f6.tar.bz2
budget-7ec5b5601fd655643ad0fe1120d56bc9b71674f6.zip
Set up enter form submi behaviour on dialog
Diffstat (limited to 'src/client/elm/View/Form.elm')
-rw-r--r--src/client/elm/View/Form.elm12
1 files changed, 11 insertions, 1 deletions
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
+ ]
+ []