From 72ff22a7589cabec1b596406877cff39cb8d3035 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 25 Apr 2019 11:14:21 -0500 Subject: [PATCH 1/2] use explicitOriginalTarget in firefox --- src/components/combo_box/combo_box.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/combo_box/combo_box.js b/src/components/combo_box/combo_box.js index 37c7d23a79a..c74506fa905 100644 --- a/src/components/combo_box/combo_box.js +++ b/src/components/combo_box/combo_box.js @@ -282,8 +282,11 @@ export class EuiComboBox extends Component { onContainerBlur = (e) => { // close the options list, unless the use clicked on an option - const focusedInOptionsList = this.optionsList && this.optionsList.contains(e.relatedTarget); - const focusedInInput = this.comboBox && this.comboBox.contains(e.relatedTarget); + + // FireFox returns `relatedTarget` as `null` for security reasons, but provides a proprietary `explicitOriginalTarget` + const relatedTarget = e.relatedTarget || e.explicitOriginalTarget; + const focusedInOptionsList = relatedTarget && this.optionsList && this.optionsList.contains(relatedTarget); + const focusedInInput = relatedTarget && this.comboBox && this.comboBox.contains(relatedTarget); if (!focusedInOptionsList && !focusedInInput) { this.closeList(); From 8c543f1e476ceb0b7d5e92e97d6814732be49f05 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 25 Apr 2019 17:06:11 -0500 Subject: [PATCH 2/2] #1885 CL entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49fec306dc8..319fa5a9a7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Fixed type definitions around `EuiI18n`'s `default` prop to better support use cases ([#1861](https://github.com/elastic/eui/pull/1861)) - Localized `EuiTablePagination`'s row count selection ([#1883](https://github.com/elastic/eui/pull/1883)) - Fixed `EuiComboBox` with `singleSelection` and `onAddCustomOption` reopening the options list after adding a custom option ([#1882](https://github.com/elastic/eui/pull/1882)) +- Fixed `EuiComboBox` reopening the options list in Firefox when closing via the dropdown arrow button ([#1885](https://github.com/elastic/eui/pull/1885)) ## [`10.1.0`](https://github.com/elastic/eui/tree/v10.1.0)