Skip to content

Commit

Permalink
修复当Login内不使用Tab时,输入框无法输入的问题 (ant-design#794)
Browse files Browse the repository at this point in the history
* 修复当Login内不使用Tab无法输入当问题

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

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

修复当用tab时子元素被清空当问题
  • Loading branch information
lyingd authored and ddcat1115 committed Jan 23, 2018
1 parent d8e591e commit 2d36097
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -104,7 +107,7 @@ class Login extends Component {
</Tabs>
{otherChildren}
</div>
) : children
) : [...children]
}
</Form>
</div>
Expand Down

0 comments on commit 2d36097

Please sign in to comment.