From 2d36097c7cf2a47f702cd73eab54443c7afc2742 Mon Sep 17 00:00:00 2001 From: lyingd Date: Tue, 23 Jan 2018 17:02:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93Login=E5=86=85?= =?UTF-8?q?=E4=B8=8D=E4=BD=BF=E7=94=A8Tab=E6=97=B6=EF=BC=8C=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E6=97=A0=E6=B3=95=E8=BE=93=E5=85=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#794)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复当Login内不使用Tab无法输入当问题 当Login内不使用Tab时,存在二个问题: 1、item有可能为空 2、输入框无法输入,执行了Login的render方法,但子组件没有执行 * 修复当用tab时子元素被清空当问题 修复当用tab时子元素被清空当问题 --- src/components/Login/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Login/index.js b/src/components/Login/index.js index 5e3a8a86..58ce0297 100644 --- a/src/components/Login/index.js +++ b/src/components/Login/index.js @@ -81,6 +81,9 @@ class Login extends Component { const TabChildren = []; const otherChildren = []; React.Children.forEach(children, (item) => { + if (!item) { + return; + } // eslint-disable-next-line if (item.type.__ANT_PRO_LOGIN_TAB) { TabChildren.push(item); @@ -104,7 +107,7 @@ class Login extends Component { {otherChildren} - ) : children + ) : [...children] } -- GitLab