From 23569edc884117cd1b9b7ef06770b9c20fdf15f6 Mon Sep 17 00:00:00 2001 From: Anish Aggarwal Date: Mon, 20 Jul 2020 23:08:18 +0530 Subject: [PATCH] Revert "Re-focus EuiSuperSelect input after making a value change (#3734)" This reverts commit c6e6e4f4376d992d951db590b6d4b8c9094b8f2b. --- CHANGELOG.md | 1 - .../__snapshots__/color_palette_picker.test.tsx.snap | 1 - .../__snapshots__/super_select.test.tsx.snap | 1 - src/components/form/super_select/super_select.tsx | 12 ------------ 4 files changed, 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4af6dd7741b..6d1ab884c07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,6 @@ - Fixed a bug in `EuiResizableContainer` preventing nested containers ([#3699](https://github.com/elastic/eui/pull/3699)) - Fixed a bug in `EuiResizableContainer` preventing resizing by arrow keys in some cases ([#3699](https://github.com/elastic/eui/pull/3699)) - Fixed `EuiHorizontalSteps` rendering over `EuiHeader` ([#3707](https://github.com/elastic/eui/pull/3707)) -- Fixed bug where `EuiSuperSelect` lost focus after a value selection ([#3734](https://github.com/elastic/eui/pull/3734)) **Breaking changes** diff --git a/src/components/color_picker/color_palette_picker/__snapshots__/color_palette_picker.test.tsx.snap b/src/components/color_picker/color_palette_picker/__snapshots__/color_palette_picker.test.tsx.snap index 4f5462bd6dd..efb9a26ad61 100644 --- a/src/components/color_picker/color_palette_picker/__snapshots__/color_palette_picker.test.tsx.snap +++ b/src/components/color_picker/color_palette_picker/__snapshots__/color_palette_picker.test.tsx.snap @@ -710,7 +710,6 @@ exports[`EuiColorPalettePicker more props are propagated to each option 2`] = ` value="paletteFixed" /> } - buttonRef={[Function]} className="euiSuperSelect" closePopover={[Function]} display="block" diff --git a/src/components/form/super_select/__snapshots__/super_select.test.tsx.snap b/src/components/form/super_select/__snapshots__/super_select.test.tsx.snap index 22679969f1c..f0958f150b8 100644 --- a/src/components/form/super_select/__snapshots__/super_select.test.tsx.snap +++ b/src/components/form/super_select/__snapshots__/super_select.test.tsx.snap @@ -558,7 +558,6 @@ exports[`EuiSuperSelect props more props are propogated to each option 2`] = ` value="1" /> } - buttonRef={[Function]} className="euiSuperSelect" closePopover={[Function]} display="block" diff --git a/src/components/form/super_select/super_select.tsx b/src/components/form/super_select/super_select.tsx index a331e7725d8..0a5771377ca 100644 --- a/src/components/form/super_select/super_select.tsx +++ b/src/components/form/super_select/super_select.tsx @@ -101,14 +101,6 @@ export class EuiSuperSelect extends Component< private itemNodes: Array = []; private popoverRef: HTMLDivElement | null = null; - private buttonRef: HTMLElement | null = null; - private setButtonRef = (popoverButtonRef: HTMLDivElement | null) => { - if (popoverButtonRef) { - this.buttonRef = popoverButtonRef.querySelector('button')!; - } else { - this.buttonRef = null; - } - }; private _isMounted: boolean = false; state = { @@ -186,9 +178,6 @@ export class EuiSuperSelect extends Component< if (this.props.onChange) { this.props.onChange(value); } - if (this.buttonRef) { - this.buttonRef.focus(); - } }; onSelectKeyDown = (event: React.KeyboardEvent) => { @@ -350,7 +339,6 @@ export class EuiSuperSelect extends Component< anchorPosition="downCenter" ownFocus={false} popoverRef={this.setPopoverRef} - buttonRef={this.setButtonRef} hasArrow={false} buffer={0}>