+
Date: Thu, 27 Oct 2022 12:32:31 -0700
Subject: [PATCH 14/16] changelog
---
upcoming_changelogs/6036.md | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 upcoming_changelogs/6036.md
diff --git a/upcoming_changelogs/6036.md b/upcoming_changelogs/6036.md
new file mode 100644
index 00000000000..85b40b6475b
--- /dev/null
+++ b/upcoming_changelogs/6036.md
@@ -0,0 +1,2 @@
+- Added a keyboard shortcuts popover to `EuiDataGrid`'s toolbar. This can be visually hidden via `toolbarVisibility.showKeyboardShortcuts`, but will always remain accessible to keyboard and screen reader users.
+- `EuiScreenReaderOnly`'s `showOnFocus` prop now also shows on focus within its children
From 131408e73bc595efde9206594a9dd55e10498e6f Mon Sep 17 00:00:00 2001
From: Constance Chen
Date: Thu, 27 Oct 2022 14:07:54 -0700
Subject: [PATCH 15/16] Update/fix datagrid E2E tests
---
src/components/datagrid/data_grid.spec.tsx | 6 ++++++
src/components/datagrid/utils/scrolling.spec.tsx | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/components/datagrid/data_grid.spec.tsx b/src/components/datagrid/data_grid.spec.tsx
index c6e3949f921..7be81fb1d05 100644
--- a/src/components/datagrid/data_grid.spec.tsx
+++ b/src/components/datagrid/data_grid.spec.tsx
@@ -268,6 +268,12 @@ describe('EuiDataGrid', () => {
'dataGridColumnSelectorButton'
);
cy.realPress('Tab');
+ cy.focused().should(
+ 'have.attr',
+ 'data-test-subj',
+ 'dataGridKeyboardShortcutsButton'
+ );
+ cy.realPress('Tab');
cy.focused().should(
'have.attr',
'data-test-subj',
diff --git a/src/components/datagrid/utils/scrolling.spec.tsx b/src/components/datagrid/utils/scrolling.spec.tsx
index dbdbf4b5eeb..90b851e823c 100644
--- a/src/components/datagrid/utils/scrolling.spec.tsx
+++ b/src/components/datagrid/utils/scrolling.spec.tsx
@@ -37,7 +37,7 @@ describe('useScroll', () => {
describe('cell focus', () => {
it('fully scrolls cells into view (accounting for sticky headers, rows, and scrollbars)', () => {
cy.realMount();
- cy.repeatRealPress('Tab', 3);
+ cy.repeatRealPress('Tab', 4);
cy.realPress('ArrowDown');
cy.realPress('End');
From 2fed236a6c47058dc86c1a4055d1aabe9da767f2 Mon Sep 17 00:00:00 2001
From: Constance Chen
Date: Mon, 31 Oct 2022 15:22:36 -0700
Subject: [PATCH 16/16] [PR feedback] Copy
---
.../keyboard_shortcuts.test.tsx.snap | 24 +++++++++----------
.../_data_grid_keyboard_shortcuts.scss | 2 +-
.../datagrid/controls/keyboard_shortcuts.tsx | 24 +++++++++----------
3 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/src/components/datagrid/controls/__snapshots__/keyboard_shortcuts.test.tsx.snap b/src/components/datagrid/controls/__snapshots__/keyboard_shortcuts.test.tsx.snap
index 8778d0ae4c5..7ca2c1f6b8c 100644
--- a/src/components/datagrid/controls/__snapshots__/keyboard_shortcuts.test.tsx.snap
+++ b/src/components/datagrid/controls/__snapshots__/keyboard_shortcuts.test.tsx.snap
@@ -104,7 +104,7 @@ exports[`useDataGridKeyboardShortcuts returns a popover containing a list of key
- Moves focus one cell up.
+ Move one cell up
- Moves focus one cell down.
+ Move one cell down
- Moves focus one cell to the right.
+ Move one cell right
- Moves focus one cell to the left.
+ Move one cell left
- Moves focus to the first cell in the current row.
+ Move to the first cell of the current row
- Moves focus to the last cell in the current row.
+ Move to the last cell of the current row
- Moves focus to the first cell in the first row.
+ Move to the first cell of the current page
- Moves focus to the last cell in the last row.
+ Move to the last cell of the current page
- Paginates to the last row of the previous page.
+ Go to the last row of the previous page
- Paginates to the first row of the next page.
+ Go to the first row of the next page
- Opens cell expansion popover for interactive cells.
+ Open cell details and actions
- Closes any open popovers.
+ Close cell details and actions
diff --git a/src/components/datagrid/controls/_data_grid_keyboard_shortcuts.scss b/src/components/datagrid/controls/_data_grid_keyboard_shortcuts.scss
index e60250b56f1..bc991600e2b 100644
--- a/src/components/datagrid/controls/_data_grid_keyboard_shortcuts.scss
+++ b/src/components/datagrid/controls/_data_grid_keyboard_shortcuts.scss
@@ -1,6 +1,6 @@
.euiDataGrid__keyboardShortcuts {
display: block;
- max-inline-size: $euiSizeXXL * 12;
+ max-inline-size: $euiSizeXXL * 10;
max-block-size: 80vh;
overflow-y: auto;
overflow-block: auto;
diff --git a/src/components/datagrid/controls/keyboard_shortcuts.tsx b/src/components/datagrid/controls/keyboard_shortcuts.tsx
index 55d6993713e..9d01a3ceb79 100644
--- a/src/components/datagrid/controls/keyboard_shortcuts.tsx
+++ b/src/components/datagrid/controls/keyboard_shortcuts.tsx
@@ -67,7 +67,7 @@ export const useDataGridKeyboardShortcuts = (): {
description: (
),
},
@@ -83,7 +83,7 @@ export const useDataGridKeyboardShortcuts = (): {
description: (
),
},
@@ -99,7 +99,7 @@ export const useDataGridKeyboardShortcuts = (): {
description: (
),
},
@@ -115,7 +115,7 @@ export const useDataGridKeyboardShortcuts = (): {
description: (
),
},
@@ -131,7 +131,7 @@ export const useDataGridKeyboardShortcuts = (): {
description: (
),
},
@@ -147,7 +147,7 @@ export const useDataGridKeyboardShortcuts = (): {
description: (
),
},
@@ -171,7 +171,7 @@ export const useDataGridKeyboardShortcuts = (): {
description: (
),
},
@@ -195,7 +195,7 @@ export const useDataGridKeyboardShortcuts = (): {
description: (
),
},
@@ -211,7 +211,7 @@ export const useDataGridKeyboardShortcuts = (): {
description: (
),
},
@@ -227,7 +227,7 @@ export const useDataGridKeyboardShortcuts = (): {
description: (
),
},
@@ -243,7 +243,7 @@ export const useDataGridKeyboardShortcuts = (): {
description: (
),
},
@@ -259,7 +259,7 @@ export const useDataGridKeyboardShortcuts = (): {
description: (
),
},