Skip to content

Commit

Permalink
Tweak button insert space logic
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Aug 15, 2017
1 parent 48f7d22 commit 59b11f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 59b11f3

Please sign in to comment.