mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-25 14:42:37 +03:00
SegmentedControl.V7 uses aria-current attribute
This commit is contained in:
parent
1714a0f065
commit
0c4e79b2ee
@ -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
|
||||||
, css sharedTabStyles
|
[ [ Role.tab
|
||||||
, css <|
|
, css sharedTabStyles
|
||||||
if option.value == config.selected then
|
]
|
||||||
focusedTabStyles
|
, if option.value == config.selected then
|
||||||
|
[ 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 ""
|
||||||
|
Loading…
Reference in New Issue
Block a user