From ebde3e5774deb5234e52c45e4e07a7c9f6f76f65 Mon Sep 17 00:00:00 2001 From: valleykid Date: Mon, 13 Nov 2017 20:17:27 +0800 Subject: [PATCH] Fixed bug#140 (#164) --- src/layouts/BasicLayout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index 84ec4e62..47fd8782 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -206,7 +206,7 @@ class BasicLayout extends React.PureComponent { handleOpenChange = (openKeys) => { const lastOpenKey = openKeys[openKeys.length - 1]; const isMainMenu = this.menus.some( - item => (item.key === lastOpenKey || item.path === lastOpenKey) + item => lastOpenKey && (item.key === lastOpenKey || item.path === lastOpenKey) ); this.setState({ openKeys: isMainMenu ? [lastOpenKey] : [...openKeys], -- GitLab