Fix the bug<Button>{0}</Button> display abnormal #8733
Merged
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 |
yesmeck
Dec 27, 2017
Member
Just break it to two lines.
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.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
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 :