From f475ce95db5b3f364fb52702cd31aeb81e9db9e0 Mon Sep 17 00:00:00 2001 From: Michail Yasonik Date: Sat, 12 Oct 2019 02:55:25 +0530 Subject: [PATCH] Fixes several a11y issues manifesting in Kibana (#2411) Fixes several of misc a11y issues showing up in Kibana: - Poor labeling in `EuiSuperDatePicker` ([Kibana issue 38794](https://github.com/elastic/kibana/issues/38794)) (this kind of snowballed into improving several things in the vicinity) - Fixes #2416: `EuiFormRow`s that render fields that also render a label end up rendering multiple labels for an input which breaks many assistive tech (this issue was found during the in progress Kibana rollout of automated a11y testing ([Kibana issue 43584](https://github.com/elastic/kibana/pull/43584) ) - Fixes #2414: `EuiCodeEditor`s would render with the same ID which breaks many assistive tech (this issue was found during the in progress Kibana rollout of automated a11y testing) --- CHANGELOG.md | 6 +- src-docs/src/views/form_layouts/form_rows.js | 5 +- .../__snapshots__/code_editor.test.js.snap | 22 +- src/components/code_editor/code_editor.js | 1 + .../code_editor/code_editor.test.js | 4 +- .../date_popover/relative_tab.js | 101 +++-- .../__snapshots__/quick_select.test.js.snap | 382 ++++++++---------- .../_commonly_used_time_ranges.scss | 4 + .../quick_select_popover/_index.scss | 1 + .../quick_select_popover/_quick_select.scss | 3 +- .../_quick_select_popover.scss | 3 +- .../commonly_used_time_ranges.js | 35 +- .../quick_select_popover/quick_select.js | 177 +++++--- .../quick_select_popover/quick_select.test.js | 6 + .../quick_select_popover/refresh_interval.js | 54 ++- .../__snapshots__/flex_item.test.tsx.snap | 18 - src/components/flex/flex_grid.tsx | 11 +- src/components/flex/flex_item.test.tsx | 24 +- src/components/flex/flex_item.tsx | 4 +- .../described_form_group.test.js.snap | 7 +- .../__snapshots__/form_row.test.js.snap | 32 +- src/components/form/form_row/form_row.js | 19 +- 22 files changed, 514 insertions(+), 405 deletions(-) create mode 100644 src/components/date_picker/super_date_picker/quick_select_popover/_commonly_used_time_ranges.scss diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e8547e7ce8..298710f9ff7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,17 @@ - Added new `EuiColorStops` component ([#2360](https://github.com/elastic/eui/pull/2360)) - Added `currency` glyph to 'EuiIcon' ([#2398](https://github.com/elastic/eui/pull/2398)) - Migrate `EuiBreadcrumbs`, `EuiHeader` etc, and `EuiLink` to TypeScript ([#2391](https://github.com/elastic/eui/pull/2391)) +- Added `hasChildLabel` prop to `EuiFormRow` to avoid duplicate labels ([#2390](https://github.com/elastic/eui/pull/2390)) - Added `component` prop to `EuiPageBody`, switching the default from `div` to `main` ([#2410](https://github.com/elastic/eui/pull/2410)) - Added focus state to `EuiListGroupItem` ([#2406](https://github.com/elastic/eui/pull/2406)) - Added `keyboardShorcut` glyph to 'EuiIcon ([#2413](https://github.com/elastic/eui/pull/2413)) **Bug fixes** -- Fix `EuiSelectable` to accept programmatic updates to its `options` prop ([#2390](https://github.com/elastic/eui/pull/2390)) +- Fixed `EuiSelectable` to accept programmatic updates to its `options` prop ([#2390](https://github.com/elastic/eui/pull/2390)) +- 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)) ## [`14.4.0`](https://github.com/elastic/eui/tree/v14.4.0) diff --git a/src-docs/src/views/form_layouts/form_rows.js b/src-docs/src/views/form_layouts/form_rows.js index 42b14c9ab53..312c0350b2b 100644 --- a/src-docs/src/views/form_layouts/form_rows.js +++ b/src-docs/src/views/form_layouts/form_rows.js @@ -117,7 +117,10 @@ export default class extends Component { - + @@ -25,7 +25,7 @@ exports[`EuiCodeEditor behavior hint element should be enabled when the ui ace b
@@ -46,7 +46,7 @@ exports[`EuiCodeEditor behavior hint element should be tabable 1`] = `
@@ -71,7 +71,7 @@ exports[`EuiCodeEditor is rendered 1`] = `
@@ -88,7 +88,7 @@ exports[`EuiCodeEditor is rendered 1`] = `