From e0e5d3b7102cac267ea3eb5691d5545302262729 Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Wed, 2 Mar 2022 13:59:00 -0800 Subject: [PATCH 1/3] Ensure cell popovers close when focus trap is deactivated (which should occur when clicking back into the originating cell) --- src/components/datagrid/body/data_grid_cell_popover.test.tsx | 1 + src/components/datagrid/body/data_grid_cell_popover.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/datagrid/body/data_grid_cell_popover.test.tsx b/src/components/datagrid/body/data_grid_cell_popover.test.tsx index c519f10cab7..bbb123d58cd 100644 --- a/src/components/datagrid/body/data_grid_cell_popover.test.tsx +++ b/src/components/datagrid/body/data_grid_cell_popover.test.tsx @@ -101,6 +101,7 @@ describe('useCellPopover', () => { hasArrow={false} isOpen={true} onKeyDown={[Function]} + onTrapDeactivation={[Function]} panelClassName="euiDataGridRowCell__popover" panelPaddingSize="s" panelProps={ diff --git a/src/components/datagrid/body/data_grid_cell_popover.tsx b/src/components/datagrid/body/data_grid_cell_popover.tsx index 73c93f46b8a..bd44efa6e0c 100644 --- a/src/components/datagrid/body/data_grid_cell_popover.tsx +++ b/src/components/datagrid/body/data_grid_cell_popover.tsx @@ -80,6 +80,7 @@ export const useCellPopover = (): { panelPaddingSize="s" display="block" closePopover={closeCellPopover} + onTrapDeactivation={closeCellPopover} panelProps={{ 'data-test-subj': 'euiDataGridExpansionPopover', }} From 4815151b95390d95ad4d02d33d703c888ff75457 Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Wed, 2 Mar 2022 14:08:10 -0800 Subject: [PATCH 2/3] [misc] reorder popover props slightly - to associate certain props more with one another --- .../datagrid/body/data_grid_cell_popover.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/datagrid/body/data_grid_cell_popover.tsx b/src/components/datagrid/body/data_grid_cell_popover.tsx index bd44efa6e0c..5ab67006671 100644 --- a/src/components/datagrid/body/data_grid_cell_popover.tsx +++ b/src/components/datagrid/body/data_grid_cell_popover.tsx @@ -73,17 +73,17 @@ export const useCellPopover = (): { // Note that this popover is rendered once at the top grid level, rather than one popover per cell const cellPopover = popoverIsOpen && popoverAnchor && ( { if (event.key === keys.F2 || event.key === keys.ESCAPE) { event.preventDefault(); From e667399f818ce994a0ba13f342e5337f0e41ff9c Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Wed, 2 Mar 2022 14:22:51 -0800 Subject: [PATCH 3/3] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cec19347311..1a5634c69f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ **Bug fixes** - Fixed `EuiDataGrid` cell props not resetting on column sort ([#5665](https://github.com/elastic/eui/issues/5665)) +- Fixed `EuiDataGrid` not correctly closing cell popovers when the originating cell is clicked ([#5681](https://github.com/elastic/eui/pull/5681)) - Fixed render of `EuiSelectableListItem` when no icons are present ([#5679](https://github.com/elastic/eui/issues/5679)) - Fixed render of `EuiSelectableTemplateSitewide` items when no icons are present ([#5679](https://github.com/elastic/eui/issues/5679))