Tweak button insert space logic

This commit is contained in:
afc163 2017-08-15 20:08:00 +08:00
parent 48f7d22929
commit 59b11f3b48

View File

@ -154,7 +154,7 @@ export default class Button extends React.Component<ButtonProps, any> {
const iconType = loading ? 'loading' : icon;
const iconNode = iconType ? <Icon type={iconType} /> : null;
const needInserted = React.Children.count(children) === 1 && !iconType;
const needInserted = React.Children.count(children) === 1 && (!iconType || iconType === 'loading');
const kids = React.Children.map(children, child => insertSpace(child, needInserted));
return (