diff --git a/src/Nri/Ui/SegmentedControl/V11.elm b/src/Nri/Ui/SegmentedControl/V11.elm index 3d94c67c..b1fa5f68 100644 --- a/src/Nri/Ui/SegmentedControl/V11.elm +++ b/src/Nri/Ui/SegmentedControl/V11.elm @@ -29,6 +29,7 @@ import EventExtras import Html.Styled import Html.Styled.Attributes as Attributes exposing (css, href) import Html.Styled.Events as Events +import Json.Encode as Encode import Nri.Ui import Nri.Ui.Colors.Extra exposing (withAlpha) import Nri.Ui.Colors.V1 as Colors @@ -96,7 +97,13 @@ viewRadioGroup config = (radio name (config.toString option.value) isSelected <| (Events.onCheck (\_ -> config.onSelect option.value) :: css [ Css.opacity Css.zero ] - :: Attributes.checked isSelected + :: Attributes.attribute "data-nri-checked" + (if isSelected then + "true" + + else + "false" + ) :: Style.invisible ) ) diff --git a/tests/Spec/Nri/Ui/SegmentedControl.elm b/tests/Spec/Nri/Ui/SegmentedControl.elm index 877171d8..90b06725 100644 --- a/tests/Spec/Nri/Ui/SegmentedControl.elm +++ b/tests/Spec/Nri/Ui/SegmentedControl.elm @@ -54,7 +54,7 @@ spec = , Selector.containing [ Selector.tag "input" , Selector.attribute (Attributes.type_ "radio") - , Selector.attribute (Attributes.checked True) + , Selector.attribute (Attributes.attribute "data-nri-checked" "true") ] ] ] @@ -69,7 +69,7 @@ spec = , Selector.containing [ Selector.tag "input" , Selector.attribute (Attributes.type_ "radio") - , Selector.attribute (Attributes.checked False) + , Selector.attribute (Attributes.attribute "data-nri-checked" "false") ] ] ]