diff --git a/src/Nri/Ui/SegmentedControl/V7.elm b/src/Nri/Ui/SegmentedControl/V7.elm index fdc1f5ed..2b300a45 100644 --- a/src/Nri/Ui/SegmentedControl/V7.elm +++ b/src/Nri/Ui/SegmentedControl/V7.elm @@ -9,6 +9,7 @@ module Nri.Ui.SegmentedControl.V7 exposing (Config, Icon, Option, Width(..), vie import Accessibility.Styled exposing (..) import Accessibility.Styled.Aria as Aria import Accessibility.Styled.Role as Role +import Accessibility.Styled.Widget as Widget import Css exposing (..) import EventExtras.Styled as EventExtras import Html.Styled as Html exposing (Html) @@ -181,7 +182,7 @@ viewTab maybeToUrl forPage config option = Aria.currentPage else - Aria.currentItem True + Widget.selected True in element (List.concat diff --git a/tests/Spec/Nri/Ui/SegmentedControl/V7.elm b/tests/Spec/Nri/Ui/SegmentedControl/V7.elm index 073dccea..acd748cb 100644 --- a/tests/Spec/Nri/Ui/SegmentedControl/V7.elm +++ b/tests/Spec/Nri/Ui/SegmentedControl/V7.elm @@ -1,6 +1,7 @@ module Spec.Nri.Ui.SegmentedControl.V7 exposing (spec) import Accessibility.Aria as Aria +import Accessibility.Widget as Widget import Expect import Html.Attributes import Html.Styled @@ -45,14 +46,14 @@ spec = } |> Query.findAll [ Selector.attribute (Aria.controls "Nri-Ui-SegmentedControl-Panel-a-label") ] |> Query.index 1 - |> Query.has [ Selector.attribute (Aria.currentItem True) ] + |> Query.has [ Selector.attribute (Widget.selected True) ] , test "always has one item selected" <| \() -> toggleView { options = [ 1, 2, 3 ] , selected = 2 } - |> Query.findAll [ Selector.attribute (Aria.currentItem True) ] + |> Query.findAll [ Selector.attribute (Widget.selected True) ] |> Query.count (Expect.equal 1) ] ]