Fix checkbox (#175)

* Update src/Nri/Ui/Checkbox/V3.elm

* port to 0.18 as well
This commit is contained in:
Tereza Sokol 2018-11-16 01:30:40 -05:00 committed by Luke Westby
parent 82873bef78
commit 3d80d512c6
2 changed files with 14 additions and 2 deletions

View File

@ -248,6 +248,12 @@ viewCheckbox :
}
-> Html.Html msg
viewCheckbox model config =
let
toggledValue =
selectedToMaybe model.selected
|> Maybe.withDefault False
|> not
in
Html.Styled.span
[ css
[ display block
@ -266,7 +272,7 @@ viewCheckbox model config =
[ Html.checkbox model.identifier
(selectedToMaybe model.selected)
[ Widget.label model.label
, Events.onCheck model.setterMsg
, Events.onClick (model.setterMsg toggledValue)
, Attributes.id model.identifier
, Attributes.disabled model.disabled
]

View File

@ -248,6 +248,12 @@ viewCheckbox :
}
-> Html.Html msg
viewCheckbox model config =
let
toggledValue =
selectedToMaybe model.selected
|> Maybe.withDefault False
|> not
in
Html.Styled.span
[ css
[ display block
@ -265,7 +271,7 @@ viewCheckbox model config =
[ Html.checkbox model.identifier
(selectedToMaybe model.selected)
[ Widget.label model.label
, Events.onCheck model.setterMsg
, Events.onClick (model.setterMsg toggledValue)
, Attributes.id model.identifier
, Attributes.disabled model.disabled
]