Skip to content

Commit

Permalink
Don't create a custom combobox option if user clicked on an option (e…
Browse files Browse the repository at this point in the history
…lastic#1728)

* Don't create a custom combobox option if user clicked on an option

* changelog
  • Loading branch information
chandlerprall committed Mar 14, 2019
1 parent 6abd0b8 commit 4b4b14b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
## [`master`](https://github.com/elastic/eui/tree/master)

**Note: this release is a backport containing changes originally made in `9.0.0` and `9.1.0`**
**Note: this release is a backport containing changes originally made in `9.0.0`, `9.1.0`, and `9.4.0`**

**Bug fixes**

- Fixed keyboard navigation and UI of `EuiComboBox` items in single selection mode ([#1619](https://github.com/elastic/eui/pull/1619))
- Fixed `EuiComboBox` `activeOptonIndex` error with empty search results ([#1695](https://github.com/elastic/eui/pull/1695))
- Prevent `EuiComboBox` from creating a custom option value when user clicks on a value in the dropdown ([#1728](https://github.com/elastic/eui/pull/1728))

## [`6.10.4`](https://github.com/elastic/eui/tree/v6.10.4)

Expand Down
2 changes: 1 addition & 1 deletion src/components/combo_box/combo_box.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export class EuiComboBox extends Component {

// If the user tabs away or changes focus to another element, take whatever input they've
// typed and convert it into a pill, to prevent the combo box from looking like a text input.
if (!this.hasActiveOption() && !focusedInInput) {
if (!this.hasActiveOption() && !focusedInInput && !focusedInOptionsList) {
this.addCustomOption();
}
}
Expand Down

0 comments on commit 4b4b14b

Please sign in to comment.