From 128c8ea25f5b6b518b9d6ab8232d7869c11965fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Thu, 6 Sep 2018 22:23:21 +0800 Subject: [PATCH] fix #2177 if collapsed is true, you need to click twice to display --- src/layouts/BasicLayout.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index 58ef7e5a..4b2c1d45 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -106,8 +106,15 @@ class BasicLayout extends React.PureComponent { }); } - componentDidUpdate() { + componentDidUpdate(preProps) { + // After changing to phone mode, + // if collapsed is true, you need to click twice to display this.breadcrumbNameMap = this.getBreadcrumbNameMap(); + const { isMobile } = this.state; + const { collapsed } = this.props; + if (isMobile && !preProps.isMobile && !collapsed) { + this.handleMenuCollapse(false); + } } componentWillUnmount() { -- GitLab