mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-27 13:02:42 +03:00
Use title to attach info
This commit is contained in:
parent
d4b9aeb505
commit
ca6328f562
@ -15,6 +15,7 @@ module Nri.Ui.Svg.V1 exposing
|
||||
import Accessibility.Styled.Aria as Aria
|
||||
import Accessibility.Styled.Role as Role
|
||||
import Css exposing (Color)
|
||||
import Html.Styled.Attributes
|
||||
import Nri.Ui.Colors.Extra exposing (toCssString)
|
||||
import Svg.Styled
|
||||
import Svg.Styled.Attributes exposing (..)
|
||||
@ -120,12 +121,17 @@ toHtml (Svg record) =
|
||||
Maybe.map Aria.label record.label
|
||||
|> Maybe.withDefault (Aria.hidden True)
|
||||
|> Just
|
||||
, -- TODO: double check property
|
||||
Just Role.img
|
||||
|
||||
-- TODO: make sure svg is not focusable
|
||||
, Just Role.img
|
||||
, Just (Html.Styled.Attributes.attribute "focusable" "false")
|
||||
]
|
||||
++ record.attributes
|
||||
)
|
||||
record.icon
|
||||
(case record.label of
|
||||
Just label ->
|
||||
Svg.Styled.title [] [ Svg.Styled.text label ]
|
||||
:: record.icon
|
||||
|
||||
Nothing ->
|
||||
record.icon
|
||||
)
|
||||
|> Svg.Styled.map never
|
||||
|
@ -78,7 +78,7 @@ viewSettings state =
|
||||
[]
|
||||
]
|
||||
, Html.label []
|
||||
[ Html.text "Aria-label: "
|
||||
[ Html.text "Title: "
|
||||
, Html.input
|
||||
[ Attributes.value state.label
|
||||
, Events.onInput SetLabel
|
||||
|
Loading…
Reference in New Issue
Block a user