mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-25 06:33:09 +03:00
Fix checkbox (#175)
* Update src/Nri/Ui/Checkbox/V3.elm * port to 0.18 as well
This commit is contained in:
parent
82873bef78
commit
3d80d512c6
@ -248,6 +248,12 @@ viewCheckbox :
|
|||||||
}
|
}
|
||||||
-> Html.Html msg
|
-> Html.Html msg
|
||||||
viewCheckbox model config =
|
viewCheckbox model config =
|
||||||
|
let
|
||||||
|
toggledValue =
|
||||||
|
selectedToMaybe model.selected
|
||||||
|
|> Maybe.withDefault False
|
||||||
|
|> not
|
||||||
|
in
|
||||||
Html.Styled.span
|
Html.Styled.span
|
||||||
[ css
|
[ css
|
||||||
[ display block
|
[ display block
|
||||||
@ -266,7 +272,7 @@ viewCheckbox model config =
|
|||||||
[ Html.checkbox model.identifier
|
[ Html.checkbox model.identifier
|
||||||
(selectedToMaybe model.selected)
|
(selectedToMaybe model.selected)
|
||||||
[ Widget.label model.label
|
[ Widget.label model.label
|
||||||
, Events.onCheck model.setterMsg
|
, Events.onClick (model.setterMsg toggledValue)
|
||||||
, Attributes.id model.identifier
|
, Attributes.id model.identifier
|
||||||
, Attributes.disabled model.disabled
|
, Attributes.disabled model.disabled
|
||||||
]
|
]
|
||||||
|
@ -248,6 +248,12 @@ viewCheckbox :
|
|||||||
}
|
}
|
||||||
-> Html.Html msg
|
-> Html.Html msg
|
||||||
viewCheckbox model config =
|
viewCheckbox model config =
|
||||||
|
let
|
||||||
|
toggledValue =
|
||||||
|
selectedToMaybe model.selected
|
||||||
|
|> Maybe.withDefault False
|
||||||
|
|> not
|
||||||
|
in
|
||||||
Html.Styled.span
|
Html.Styled.span
|
||||||
[ css
|
[ css
|
||||||
[ display block
|
[ display block
|
||||||
@ -265,7 +271,7 @@ viewCheckbox model config =
|
|||||||
[ Html.checkbox model.identifier
|
[ Html.checkbox model.identifier
|
||||||
(selectedToMaybe model.selected)
|
(selectedToMaybe model.selected)
|
||||||
[ Widget.label model.label
|
[ Widget.label model.label
|
||||||
, Events.onCheck model.setterMsg
|
, Events.onClick (model.setterMsg toggledValue)
|
||||||
, Attributes.id model.identifier
|
, Attributes.id model.identifier
|
||||||
, Attributes.disabled model.disabled
|
, Attributes.disabled model.disabled
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user