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) diff --git a/src/components/combo_box/combo_box.js b/src/components/combo_box/combo_box.js index 26e3fdc0165..405f28ce1a7 100644 --- a/src/components/combo_box/combo_box.js +++ b/src/components/combo_box/combo_box.js @@ -303,8 +303,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();