From 2cbd43c3a0f0640776a4e7c7425b3210d2e6632b Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 6 Oct 2019 19:41:17 +0200 Subject: Make input label clickable again --- client/src/Component/Input.hs | 16 ++++++++++------ client/src/Component/Select.hs | 16 +++++++++------- 2 files changed, 19 insertions(+), 13 deletions(-) (limited to 'client/src') 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 "") -- cgit v1.2.3