From d046e0df0c1727e0beb846cf8669bf9dd26b7c95 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Mon, 9 Sep 2019 11:09:57 -0500 Subject: [PATCH] `EuiContextMenu` `null` check for index (#2304) * null check * CL --- CHANGELOG.md | 1 + src/components/context_menu/context_menu.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a4a18c47f0..bb4f6b9d6a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Updated TS def for `EuiFilterSelect` ([#2291](https://github.com/elastic/eui/pull/2291)) - Fixed alignment of icons and label in `EuiSideNavItem` ([#2297](https://github.com/elastic/eui/pull/2297)) +- Fixed logic in `EuiContextMenu` to account for index of `0` ([#2304](https://github.com/elastic/eui/pull/2304)) ## [`13.8.0`](https://github.com/elastic/eui/tree/v13.8.0) diff --git a/src/components/context_menu/context_menu.tsx b/src/components/context_menu/context_menu.tsx index 87b4e526739..aa23f9958e2 100644 --- a/src/components/context_menu/context_menu.tsx +++ b/src/components/context_menu/context_menu.tsx @@ -178,7 +178,7 @@ export class EuiContextMenu extends Component { } showNextPanel = (itemIndex?: number) => { - if (!itemIndex) { + if (itemIndex == null) { return; }