Skip to content
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

Cleanup around EuiSuperDatePicker quick select a11y #2426

Merged
merged 1 commit into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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