Skip to content

Commit

Permalink
[EuiSelectable+EuiComboBox] recent regresion fixes (#3784)
Browse files Browse the repository at this point in the history
* remove space as a way to select options in Selectable

* only rerender children in form row if state actually changed

* adding changelog

* Changelog tweaks

Co-authored-by: Chandler Prall <chandler.prall@gmail.com>

Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
  • Loading branch information
Michail Yasonik and chandlerprall authored Jul 22, 2020
1 parent 3bbf28c commit a71aaf8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
- 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)

Expand Down
10 changes: 8 additions & 2 deletions src/components/form/form_row/form_row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,14 @@ export class EuiFormRow extends Component<EuiFormRowProps, EuiFormRowState> {
onChildFocus(...args);
}

this.setState({
isFocused: true,
this.setState(({ isFocused }) => {
if (!isFocused) {
return {
isFocused: true,
};
} else {
return null;
}
});
};

Expand Down
1 change: 0 additions & 1 deletion src/components/selectable/selectable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class EuiSelectableListItem extends Component<
<span>
<EuiI18n
token="euiSelectableListItem.includedOptionInstructions"
default="To exclude this option, press enter or space."
default="To exclude this option, press enter."
/>
</span>
</EuiScreenReaderOnly>
Expand All @@ -156,7 +156,7 @@ export class EuiSelectableListItem extends Component<
<span>
<EuiI18n
token="euiSelectableListItem.excludedOptionInstructions"
default="To deselect this option, press enter or space."
default="To deselect this option, press enter."
/>
</span>
</EuiScreenReaderOnly>
Expand Down

0 comments on commit a71aaf8

Please sign in to comment.