Commit 2d36097c authored by lyingd's avatar lyingd Committed by ddcat1115

修复当Login内不使用Tab时,输入框无法输入的问题 (#794)

* 修复当Login内不使用Tab无法输入当问题

当Login内不使用Tab时,存在二个问题:
1、item有可能为空
2、输入框无法输入,执行了Login的render方法,但子组件没有执行

* 修复当用tab时子元素被清空当问题

修复当用tab时子元素被清空当问题
parent d8e591e9
...@@ -81,6 +81,9 @@ class Login extends Component { ...@@ -81,6 +81,9 @@ class Login extends Component {
const TabChildren = []; const TabChildren = [];
const otherChildren = []; const otherChildren = [];
React.Children.forEach(children, (item) => { React.Children.forEach(children, (item) => {
if (!item) {
return;
}
// eslint-disable-next-line // eslint-disable-next-line
if (item.type.__ANT_PRO_LOGIN_TAB) { if (item.type.__ANT_PRO_LOGIN_TAB) {
TabChildren.push(item); TabChildren.push(item);
...@@ -104,7 +107,7 @@ class Login extends Component { ...@@ -104,7 +107,7 @@ class Login extends Component {
</Tabs> </Tabs>
{otherChildren} {otherChildren}
</div> </div>
) : children ) : [...children]
} }
</Form> </Form>
</div> </div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment