New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the bug<Button>{0}</Button> display abnormal #8733
Conversation
components/button/button.tsx
Outdated
@@ -160,7 +160,8 @@ 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 || iconType === 'loading'); | |||
const kids = children ? React.Children.map(children, child => insertSpace(child, needInserted)) : null; | |||
// tslint:disable-next-line:max-line-length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just break it to two lines.
Fixes #8728 |
ping~ |
Codecov Report
@@ Coverage Diff @@
## master #8733 +/- ##
=======================================
Coverage 85.32% 85.32%
=======================================
Files 227 227
Lines 4695 4695
Branches 1375 1375
=======================================
Hits 4006 4006
Misses 689 689
Continue to review full report at Codecov.
|
First of all, thank you for your contribution! :-)
Please makes sure that these checkboxes are checked before submitting your PR, thank you!
master
, feature for latest active branchfeature-x.x
.npm run lint
and fix those errors before submitting in order to keep consistent code style.Extra checklist:
if isBugFix :
elif isNewFeature :