Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EuiComboBox in FireFox should close list on dropdown arrow click #1885

Merged
merged 3 commits into from
Apr 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
7 changes: 5 additions & 2 deletions src/components/combo_box/combo_box.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down