-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Monitoring] Address multiple accessibility issues #20619
Changes from 14 commits
ea6f802
1bf8fdb
08b2247
deb0df8
a4bcd32
3f86b94
c67a7b3
62f8683
ca1b7af
d622eb7
bf93d63
18cc017
0f2fd25
7f98d5a
ff6eea2
ec68f59
c813b48
a8fd4f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,17 +54,17 @@ const alertRowFactory = (scope, kbnUrl) => { | |
|
||
return ( | ||
<KuiTableRow> | ||
<KuiTableRowCell> | ||
<KuiTableRowCell tabIndex="0"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does each cell really need to be tabbable? Is this just to make it visible to a screen-reader? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd imagine so, otherwise the screen reader can't read any of the content in non tabbable cells There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I've found this to be true myself. I was hoping there'd be another way :D |
||
<Tooltip text={severityIcon.title} placement="bottom" trigger="hover"> | ||
<EuiHealth color={severityIcon.color} data-test-subj="alertIcon" aria-label={severityIcon.title}> | ||
{ capitalize(severityIcon.value) } | ||
</EuiHealth> | ||
</Tooltip> | ||
</KuiTableRowCell> | ||
<KuiTableRowCell> | ||
<KuiTableRowCell tabIndex="0"> | ||
{ resolution.icon } { resolution.text } | ||
</KuiTableRowCell> | ||
<KuiTableRowCell> | ||
<KuiTableRowCell tabIndex="0"> | ||
<FormattedMessage | ||
prefix={props.prefix} | ||
suffix={props.suffix} | ||
|
@@ -73,13 +73,13 @@ const alertRowFactory = (scope, kbnUrl) => { | |
changeUrl={changeUrl} | ||
/> | ||
</KuiTableRowCell> | ||
<KuiTableRowCell> | ||
<KuiTableRowCell tabIndex="0"> | ||
{ linkToCategories[props.metadata.link] ? linkToCategories[props.metadata.link] : 'General' } | ||
</KuiTableRowCell> | ||
<KuiTableRowCell> | ||
<KuiTableRowCell tabIndex="0"> | ||
{ formatDateTimeLocal(props.update_timestamp) } | ||
</KuiTableRowCell> | ||
<KuiTableRowCell> | ||
<KuiTableRowCell tabIndex="0"> | ||
{ formatTimestampToDuration(props.timestamp, CALCULATE_DURATION_SINCE) } ago | ||
</KuiTableRowCell> | ||
</KuiTableRow> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably get
EuiSwitch
tweaked to have label represent thearia-label
. This should be fine in the short term.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discussed with @elastic/kibana-design and they mentioned the consumer should manually add
aria-label
here as the assumption thatlabel
andaria-label
are the same is not always safe to make.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do wonder if the default should be for
label
to bearia-label
, but then allowaria-label
to be set explicitly for such cases.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused as to why you need to add aria-label at all. The rendered HTML of a
EuiSwitch
should look something like:which connects the input (hidden for the stylized switch look) with the form label via the
for
andid
attributes. By adding anotheraria-label
you will be duplicating that inherit accessibility. So as long as you pass both alabel
andid
, there is no need foraria-label
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay. So we either need an explicit
aria-label
OR add anid
. I'd vote the latter. Thoughts?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable to me. Seems like a good way to get good coverage of its usage.