From 759c9cf859ffbacce9f882b9c3b185c7e71c7bbd Mon Sep 17 00:00:00 2001 From: Michail Yasonik Date: Wed, 22 Jul 2020 11:04:26 -0400 Subject: [PATCH 1/4] remove space as a way to select options in Selectable --- src/components/selectable/selectable.tsx | 1 - .../selectable/selectable_list/selectable_list_item.tsx | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/selectable/selectable.tsx b/src/components/selectable/selectable.tsx index e0e5c55d335..863c32b2e4e 100644 --- a/src/components/selectable/selectable.tsx +++ b/src/components/selectable/selectable.tsx @@ -231,7 +231,6 @@ export class EuiSelectable extends Component< break; case keys.ENTER: - case keys.SPACE: event.preventDefault(); event.stopPropagation(); if (this.state.activeOptionIndex != null && optionsList) { diff --git a/src/components/selectable/selectable_list/selectable_list_item.tsx b/src/components/selectable/selectable_list/selectable_list_item.tsx index c0bc01d0086..811d9d86356 100644 --- a/src/components/selectable/selectable_list/selectable_list_item.tsx +++ b/src/components/selectable/selectable_list/selectable_list_item.tsx @@ -135,7 +135,7 @@ export class EuiSelectableListItem extends Component< @@ -156,7 +156,7 @@ export class EuiSelectableListItem extends Component< From 776d9f4a6670065456d5d6b846a1fa9b1c23e5b3 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Wed, 22 Jul 2020 13:18:56 -0400 Subject: [PATCH 2/4] only rerender children in form row if state actually changed --- src/components/form/form_row/form_row.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/form/form_row/form_row.tsx b/src/components/form/form_row/form_row.tsx index 5c48878d602..25c9ca03ba3 100644 --- a/src/components/form/form_row/form_row.tsx +++ b/src/components/form/form_row/form_row.tsx @@ -139,8 +139,14 @@ export class EuiFormRow extends Component { onChildFocus(...args); } - this.setState({ - isFocused: true, + this.setState(({ isFocused }) => { + if (!isFocused) { + return { + isFocused: true, + }; + } else { + return null; + } }); }; From 6b1bc8f5eb60657443e0e4d7ddc0d13ba23c376f Mon Sep 17 00:00:00 2001 From: Michail Yasonik Date: Wed, 22 Jul 2020 13:33:22 -0400 Subject: [PATCH 3/4] adding changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef7963857e3..46c17311762 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ - Replaced `react-focus-lock` with `react-focus-on` ([#3631](https://github.com/elastic/eui/pull/3631)) - Fixed errors in `EuiSuperDatePicker` related to invalid and `null` date formatting ([#3750](https://github.com/elastic/eui/pull/3750)) - Fixed type definitions for `findTestSubject` and `takeMountedSnapshot` ([#3763](https://github.com/elastic/eui/pull/3763)) +- Fixes `EuiComboBox` not allow clicks on previously virtualized items inside of `EuiFormRow` ([#3784](https://github.com/elastic/eui/pull/3784)) +- Removes `` as a way to select options in `EuiSelectable` ([#3784](https://github.com/elastic/eui/pull/3784)) ## [`27.1.0`](https://github.com/elastic/eui/tree/v27.1.0) From 4894c22eb498db4c28ecf58cf9faf2b856e1167a Mon Sep 17 00:00:00 2001 From: Michail Yasonik Date: Wed, 22 Jul 2020 13:58:45 -0400 Subject: [PATCH 4/4] Changelog tweaks Co-authored-by: Chandler Prall --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46c17311762..4e4d5db75d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ - Replaced `react-focus-lock` with `react-focus-on` ([#3631](https://github.com/elastic/eui/pull/3631)) - Fixed errors in `EuiSuperDatePicker` related to invalid and `null` date formatting ([#3750](https://github.com/elastic/eui/pull/3750)) - Fixed type definitions for `findTestSubject` and `takeMountedSnapshot` ([#3763](https://github.com/elastic/eui/pull/3763)) -- Fixes `EuiComboBox` not allow clicks on previously virtualized items inside of `EuiFormRow` ([#3784](https://github.com/elastic/eui/pull/3784)) -- Removes `` as a way to select options in `EuiSelectable` ([#3784](https://github.com/elastic/eui/pull/3784)) +- Fixed `EuiComboBox` not allowing clicks on previously virtualized items when inside of `EuiFormRow` ([#3784](https://github.com/elastic/eui/pull/3784)) +- Removed `[Space]` as a way to select options in `EuiSelectable` ([#3784](https://github.com/elastic/eui/pull/3784)) ## [`27.1.0`](https://github.com/elastic/eui/tree/v27.1.0)