SegmentedControl.V7 uses aria-current attribute

This commit is contained in:
Aaron VonderHaar 2019-06-04 15:14:02 -07:00
parent 1714a0f065
commit 0c4e79b2ee

View File

@ -11,7 +11,7 @@ import Accessibility.Styled.Role as Role
import Css exposing (..) import Css exposing (..)
import EventExtras.Styled as EventExtras import EventExtras.Styled as EventExtras
import Html.Styled as Html exposing (Html) import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as Attr exposing (css, href) import Html.Styled.Attributes as Attr exposing (attribute, css, href)
import Html.Styled.Events as Events import Html.Styled.Events as Events
import Nri.Ui import Nri.Ui
import Nri.Ui.Colors.Extra exposing (withAlpha) import Nri.Ui.Colors.Extra exposing (withAlpha)
@ -102,22 +102,25 @@ viewTab maybeToUrl config option =
children children
in in
element element
[ Role.tab (List.concat
[ [ Role.tab
, css sharedTabStyles , css sharedTabStyles
, css <| ]
if option.value == config.selected then , if option.value == config.selected then
focusedTabStyles [ css focusedTabStyles
, attribute "aria-current" "page"
]
else else
unFocusedTabStyles [ css unFocusedTabStyles ]
, css <| , case config.width of
case config.width of
FitContent -> FitContent ->
[] []
FillContainer -> FillContainer ->
expandingTabStyles [ css expandingTabStyles ]
] ]
)
[ case option.icon of [ case option.icon of
Nothing -> Nothing ->
Html.text "" Html.text ""