-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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 when the children is 0 and < Button > has icon prop , the width of component is wrong. #13594
Conversation
修复当值为0时样式不对问题 ,bug demo.https://codesandbox.io/s/0146v1lxkl
|
Deploy preview for ant-design ready! Built with commit c0d20fc |
Codecov Report
@@ Coverage Diff @@
## master #13594 +/- ##
==========================================
- Coverage 93.63% 93.6% -0.04%
==========================================
Files 314 314
Lines 6631 6631
Branches 1767 1767
==========================================
- Hits 6209 6207 -2
- Misses 410 412 +2
Partials 12 12
Continue to review full report at Codecov.
|
2 similar comments
Codecov Report
@@ Coverage Diff @@
## master #13594 +/- ##
==========================================
- Coverage 93.63% 93.6% -0.04%
==========================================
Files 314 314
Lines 6631 6631
Branches 1767 1767
==========================================
- Hits 6209 6207 -2
- Misses 410 412 +2
Partials 12 12
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #13594 +/- ##
==========================================
- Coverage 93.63% 93.6% -0.04%
==========================================
Files 314 314
Lines 6631 6631
Branches 1767 1767
==========================================
- Hits 6209 6207 -2
- Misses 410 412 +2
Partials 12 12
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #13594 +/- ##
==========================================
- Coverage 93.63% 93.6% -0.04%
==========================================
Files 314 314
Lines 6631 6631
Branches 1767 1767
==========================================
- Hits 6209 6207 -2
- Misses 410 412 +2
Partials 12 12
Continue to review full report at Codecov.
|
@@ -207,7 +207,7 @@ export default class Button extends React.Component<ButtonProps, any> { | |||
[`${prefixCls}-${type}`]: type, | |||
[`${prefixCls}-${shape}`]: shape, | |||
[`${prefixCls}-${sizeCls}`]: sizeCls, | |||
[`${prefixCls}-icon-only`]: !children && icon, | |||
[`${prefixCls}-icon-only`]: (!children && children!==0) && icon, |
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.
这里 ci 直接没用了。
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.
查了一下,eslint 里是 space-infix-ops
,tslint 是 whitespace
,我们以前没设过。
我给 antd-tools 加上去。
Fix the bug when the children is 0 and
< Button >
hasicon
prop , the width of component is wrong.bug demo: https://codesandbox.io/s/0146v1lxkl
First of all, thank you for your contribution! :-)
Please makes sure that these checkboxes are checked before submitting your pull request, thank you!
master
, feature for branchfeature
.npm run lint
and fix those errors before submitting in order to keep consistent code style.Extra checklist:
if isBugFix :
I am sorry that I have not been able to add a unit test because the enzyme cannot get the width of the component enzymejs/enzyme#1940