aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorJoris2019-10-06 19:41:17 +0200
committerJoris2019-10-06 19:41:17 +0200
commit2cbd43c3a0f0640776a4e7c7425b3210d2e6632b (patch)
treedd832cf562c1eb9f41f5909c16c5cf3e55386b97 /client
parentf4c5df9e1b1afddeb5a482d4fbe654d0b321159c (diff)
Make input label clickable again
Diffstat (limited to 'client')
-rw-r--r--client/src/Component/Input.hs16
-rw-r--r--client/src/Component/Select.hs16
2 files changed, 19 insertions, 13 deletions
diff --git a/client/src/Component/Input.hs b/client/src/Component/Input.hs
index abdc51c..0c84754 100644
--- a/client/src/Component/Input.hs
+++ b/client/src/Component/Input.hs
@@ -75,13 +75,17 @@ input inputIn reset validate = do
(textInput, resetClic) <- R.elDynAttr "div" containerAttr $ do
- textInput <- R.textInput $ R.def
- & R.attributes .~ inputAttr
- & R.setValue .~ resetValue
- & R.textInputConfig_initialValue .~ (_inputIn_initialValue inputIn)
- & R.textInputConfig_inputType .~ (_inputIn_inputType inputIn)
+ textInput <- R.el "label" $ do
+ textInput <- R.textInput $ R.def
+ & R.attributes .~ inputAttr
+ & R.setValue .~ resetValue
+ & R.textInputConfig_initialValue .~ (_inputIn_initialValue inputIn)
+ & R.textInputConfig_inputType .~ (_inputIn_inputType inputIn)
- R.el "label" $ R.text (_inputIn_label inputIn)
+ R.divClass "label" $
+ R.text (_inputIn_label inputIn)
+
+ return textInput
resetClic <-
if _inputIn_hasResetButton inputIn
diff --git a/client/src/Component/Select.hs b/client/src/Component/Select.hs
index 9a37afc..5980ed2 100644
--- a/client/src/Component/Select.hs
+++ b/client/src/Component/Select.hs
@@ -57,8 +57,6 @@ select selectIn = do
]
value <- R.elDynAttr "div" containerAttr $ do
- R.el "label" $ R.text (_selectIn_label selectIn)
-
let initialValue = _selectIn_initialValue selectIn
let setValue = R.leftmost
@@ -66,11 +64,15 @@ select selectIn = do
, _selectIn_value selectIn
]
- value <- R._dropdown_value <$>
- R.dropdown
- initialValue
- (_selectIn_values selectIn)
- (R.def { R._dropdownConfig_setValue = setValue })
+ value <- R.el "label" $ do
+ R.divClass "label" $
+ R.text (_selectIn_label selectIn)
+
+ R._dropdown_value <$>
+ R.dropdown
+ initialValue
+ (_selectIn_values selectIn)
+ (R.def { R._dropdownConfig_setValue = setValue })
R.divClass "errorMessage" . R.dynText $
R.ffor showedError (Maybe.fromMaybe "")