From 7d2c42799befcc02df2f3b5b0d4bd4e7736ddaac Mon Sep 17 00:00:00 2001 From: pablohirafuji Date: Mon, 24 Oct 2016 09:54:38 -0200 Subject: [PATCH] Fix example's Reset action When using defaultValue, to have control over the text elements value, we must set the `value` attribute to reflect the model state. --- example/src/View/Bootstrap.elm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/example/src/View/Bootstrap.elm b/example/src/View/Bootstrap.elm index 6b3ebd8..a3f777a 100644 --- a/example/src/View/Bootstrap.elm +++ b/example/src/View/Bootstrap.elm @@ -45,14 +45,22 @@ textGroup : GroupBuilder String textGroup label' state = formGroup label' state.liveError - [ Input.textInput state [ class "form-control" ] ] + [ Input.textInput state + [ class "form-control" + , value (Maybe.withDefault "" state.value) + ] + ] textAreaGroup : GroupBuilder String textAreaGroup label' state = formGroup label' state.liveError - [ Input.textArea state [ class "form-control" ] ] + [ Input.textArea state + [ class "form-control" + , value (Maybe.withDefault "" state.value) + ] + ] checkboxGroup : GroupBuilder Bool