From 74841def16cb642fdacf0feb2a632ed1d63b4c5f Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Wed, 25 Nov 2020 07:28:06 -0700 Subject: [PATCH] Revert "[EuiPopover] Default to ownFocus (#4228)" This reverts commit da291a13f1a5ab3bb71620492f7c7acd45c4d629. --- CHANGELOG.md | 1 - src-docs/src/views/color_picker/containers.js | 1 + src-docs/src/views/combo_box/containers.js | 1 + .../src/views/datagrid/control_columns.js | 6 +- src-docs/src/views/datagrid/datagrid.js | 3 +- src-docs/src/views/expression/columns.js | 2 + src-docs/src/views/expression/expression.js | 2 + .../src/views/filter_group/filter_group.js | 1 + .../views/filter_group/filter_group_multi.js | 1 + .../src/views/form_layouts/inline_popover.js | 2 + src-docs/src/views/header/header.js | 3 + src-docs/src/views/header/header_alert.js | 1 + .../views/header/header_elastic_pattern.js | 3 + src-docs/src/views/popover/popover.js | 1 + .../views/popover/popover_anchor_position.js | 12 ++ src-docs/src/views/popover/popover_block.js | 1 + .../src/views/popover/popover_container.js | 1 + src-docs/src/views/popover/popover_example.js | 9 +- src-docs/src/views/popover/popover_fixed.js | 1 + .../popover/popover_htmlelement_anchor.js | 1 + .../views/popover/popover_panel_class_name.js | 1 + .../src/views/popover/popover_with_title.js | 3 + .../popover/popover_with_title_padding.js | 6 + src-docs/src/views/popover/trap_focus.js | 1 - .../collapsed_item_actions.test.tsx.snap | 2 +- .../in_memory_table.test.tsx.snap | 105 ++++++++++-------- src/components/datagrid/column_selector.tsx | 1 + src/components/datagrid/column_sorting.tsx | 2 + .../datagrid/data_grid_cell_popover.tsx | 1 + src/components/datagrid/style_selector.tsx | 1 + .../date_popover/date_popover_button.tsx | 1 + .../quick_select_popover.tsx | 3 +- .../header/header_links/header_links.tsx | 1 + .../__snapshots__/popover.test.tsx.snap | 103 ++++------------- src/components/popover/popover.test.tsx | 7 +- src/components/popover/popover.tsx | 2 +- .../filters/field_value_selection_filter.tsx | 1 + .../table/mobile/table_sort_mobile.tsx | 1 + src/components/tour/tour_step.tsx | 1 - 39 files changed, 151 insertions(+), 145 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b01c4acb162..ff92480b3ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,6 @@ - Added `EuiColorPaletteDisplay` component ([#3865](https://github.com/elastic/eui/pull/3865)) - Added `initialFocusedItemIndex` support to `EuiContextMenuPanelDescriptor` ([#4223](https://github.com/elastic/eui/pull/4223)) -- Updated the default of the `EuiPopover`s `ownFocus` prop from `false` to `true` ([#4228](https://github.com/elastic/eui/pull/4228)) - Added `role="alert"` and `aria-live="assertive"` to `EuiForm`'s `EuiCallOut` for the errors ([#4238](https://github.com/elastic/eui/pull/4238)) - Added `menuDown` and `menuUp` glyphs to `EuiIcon` ([#4244](https://github.com/elastic/eui/pull/4244)) - Removed spacer after `childrenBetween` in `EuiInMemoryTable` ([#4248](https://github.com/elastic/eui/pull/4248)) diff --git a/src-docs/src/views/color_picker/containers.js b/src-docs/src/views/color_picker/containers.js index eb654f4933b..7e70312e2bc 100644 --- a/src-docs/src/views/color_picker/containers.js +++ b/src-docs/src/views/color_picker/containers.js @@ -98,6 +98,7 @@ export default () => { diff --git a/src-docs/src/views/combo_box/containers.js b/src-docs/src/views/combo_box/containers.js index 135bc3b9845..de12e482761 100644 --- a/src-docs/src/views/combo_box/containers.js +++ b/src-docs/src/views/combo_box/containers.js @@ -146,6 +146,7 @@ export default () => { diff --git a/src-docs/src/views/datagrid/control_columns.js b/src-docs/src/views/datagrid/control_columns.js index 2128386fc8b..46efe053ece 100644 --- a/src-docs/src/views/datagrid/control_columns.js +++ b/src-docs/src/views/datagrid/control_columns.js @@ -95,7 +95,8 @@ const SelectionButton = () => { selected } - closePopover={() => setIsPopoverOpen(false)}> + closePopover={() => setIsPopoverOpen(false)} + ownFocus={true}> {selectedRows.size} {selectedRows.size > 1 ? 'items' : 'item'} @@ -264,7 +265,8 @@ const trailingControlColumns = [ onClick={() => setIsPopoverOpen(!isPopoverOpen)} /> } - closePopover={() => setIsPopoverOpen(false)}> + closePopover={() => setIsPopoverOpen(false)} + ownFocus={true}> Actions
- + + + +
- +
diff --git a/src/components/datagrid/column_selector.tsx b/src/components/datagrid/column_selector.tsx index 3822478aff1..5e134477fe4 100644 --- a/src/components/datagrid/column_selector.tsx +++ b/src/components/datagrid/column_selector.tsx @@ -150,6 +150,7 @@ export const useDataGridColumnSelector = ( isOpen={isOpen} closePopover={() => setIsOpen(false)} anchorPosition="downLeft" + ownFocus panelPaddingSize="s" panelClassName="euiDataGridColumnSelectorPopover" button={ diff --git a/src/components/datagrid/column_sorting.tsx b/src/components/datagrid/column_sorting.tsx index 890d1562d61..542e057181f 100644 --- a/src/components/datagrid/column_sorting.tsx +++ b/src/components/datagrid/column_sorting.tsx @@ -141,6 +141,7 @@ export const useDataGridColumnSorting = ( isOpen={isOpen} closePopover={() => setIsOpen(false)} anchorPosition="downLeft" + ownFocus panelPaddingSize="s" panelClassName="euiDataGridColumnSortingPopover" button={ @@ -211,6 +212,7 @@ export const useDataGridColumnSorting = ( isOpen={avilableColumnsisOpen} closePopover={() => setAvailableColumnsIsOpen(false)} anchorPosition="downLeft" + ownFocus panelPaddingSize="none" button={ setIsOpen(false)} anchorPosition="downCenter" + ownFocus panelPaddingSize="s" panelClassName="euiDataGridColumnSelectorPopover" button={ diff --git a/src/components/date_picker/super_date_picker/date_popover/date_popover_button.tsx b/src/components/date_picker/super_date_picker/date_popover/date_popover_button.tsx index 4da6acccebd..918775d6a23 100644 --- a/src/components/date_picker/super_date_picker/date_popover/date_popover_button.tsx +++ b/src/components/date_picker/super_date_picker/date_popover/date_popover_button.tsx @@ -112,6 +112,7 @@ export const EuiDatePopoverButton: FunctionComponent anchorPosition={position === 'start' ? 'downLeft' : 'downRight'} display="block" panelPaddingSize="none" + ownFocus {...rest}> + anchorClassName="euiQuickSelectPopover__anchor" + ownFocus>
diff --git a/src/components/header/header_links/header_links.tsx b/src/components/header/header_links/header_links.tsx index 39fab32d0a1..6899c3fa391 100644 --- a/src/components/header/header_links/header_links.tsx +++ b/src/components/header/header_links/header_links.tsx @@ -134,6 +134,7 @@ export const EuiHeaderLinks: FunctionComponent = ({ @@ -163,25 +154,16 @@ exports[`EuiPopover props buffer 1`] = ` data-focus-lock-disabled="disabled" >