Skip to content

Commit

Permalink
Cleanup around EuiSuperDatePicker quick select a11y
Browse files Browse the repository at this point in the history
  • Loading branch information
Michail Yasonik committed Oct 14, 2019
1 parent f475ce9 commit e53b00a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 32 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Fixed poor labeling in `EuiSuperDatePicker` ([#2390](https://github.com/elastic/eui/pull/2411))
- Fixed `EuiCodeEditor`'s ID to be dynamic between renders ([#2390](https://github.com/elastic/eui/pull/2411))
- Fixed `EuiCodeEditor` to not render multiple labels for some inputs ([#2390](https://github.com/elastic/eui/pull/2411))
- Continues a11y fixes in `EuiSuperDatePicker` ([#2426](https://github.com/elastic/eui/pull/2426))

## [`14.4.0`](https://github.com/elastic/eui/tree/v14.4.0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,8 @@
exports[`EuiQuickSelect is rendered 1`] = `
<fieldset>
<EuiI18n
defaults={
Array [
"Quick select a time range",
"Quick select",
]
}
tokens={
Array [
"euiQuickSelect.legendLabel",
"euiQuickSelect.legendText",
]
}
default="Quick select a time range"
token="euiQuickSelect.legendText"
>
<Component />
</EuiI18n>
Expand Down Expand Up @@ -139,18 +129,8 @@ exports[`EuiQuickSelect is rendered 1`] = `
exports[`EuiQuickSelect prevQuickSelect 1`] = `
<fieldset>
<EuiI18n
defaults={
Array [
"Quick select a time range",
"Quick select",
]
}
tokens={
Array [
"euiQuickSelect.legendLabel",
"euiQuickSelect.legendText",
]
}
default="Quick select a time range"
token="euiQuickSelect.legendText"
>
<Component />
</EuiI18n>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,13 @@ export class EuiQuickSelect extends Component {
return (
<fieldset>
<EuiI18n
tokens={['euiQuickSelect.legendLabel', 'euiQuickSelect.legendText']}
defaults={['Quick select a time range', 'Quick select']}>
{([legendLabel, legendText]) => (
token="euiQuickSelect.legendText"
default="Quick select a time range">
{legendText => (
// Legend needs to be the first thing in a fieldset, but we want the visible title within the flex.
// So we hide it, but allow screen readers to see it
<EuiScreenReaderOnly>
<legend
id={legendId}
aria-label={legendLabel}
className="euiFormLabel">
<legend id={legendId} className="euiFormLabel">
{legendText}
</legend>
</EuiScreenReaderOnly>
Expand All @@ -149,7 +146,7 @@ export class EuiQuickSelect extends Component {
token="euiQuickSelect.quickSelectTitle"
default="Quick select">
{quickSelectTitle => (
<div id={legendId} aria-hidden className="euiFormLabel">
<div aria-hidden className="euiFormLabel">
{quickSelectTitle}
</div>
)}
Expand Down

0 comments on commit e53b00a

Please sign in to comment.