Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

951565664
Copy link
Contributor

Fix the bug when the children is 0 and < Button > has icon prop , the width of component is wrong.

image

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!

  • Make sure that you propose pull request to right branch: bugfix for master, feature for branch feature.
  • Make sure that you follow antd's code convention.
  • Run npm run lint and fix those errors before submitting in order to keep consistent code style.
  • Rebase before creating a pull request to keep commit history clear.
  • Add some descriptions and refer relative issues for you pull request.

Extra checklist:

if isBugFix :

  • Make sure that you add at least one unit test for the bug which you had fixed.

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

修复当值为0时样式不对问题 ,bug demo.https://codesandbox.io/s/0146v1lxkl
@afc163
Copy link
Member

afc163 commented Dec 12, 2018

  • Please fix ci.
  • Please use English in commit message.

@951565664 951565664 changed the title 修复当值为0时样式不对问题 Fix the bug when the children is 0 and < Button > has icon prop , the width of component is wrong. Dec 12, 2018
@netlify
Copy link

netlify bot commented Dec 12, 2018

Deploy preview for ant-design ready!

Built with commit c0d20fc

https://deploy-preview-13594--ant-design.netlify.com

@codecov
Copy link

codecov bot commented Dec 12, 2018

Codecov Report

Merging #13594 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
components/button/button.tsx 93.4% <100%> (ø) ⬆️
components/upload/UploadList.tsx 88.49% <0%> (-1.77%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a66546...5dd41e9. Read the comment docs.

2 similar comments
@codecov
Copy link

codecov bot commented Dec 12, 2018

Codecov Report

Merging #13594 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
components/button/button.tsx 93.4% <100%> (ø) ⬆️
components/upload/UploadList.tsx 88.49% <0%> (-1.77%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a66546...5dd41e9. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 12, 2018

Codecov Report

Merging #13594 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
components/button/button.tsx 93.4% <100%> (ø) ⬆️
components/upload/UploadList.tsx 88.49% <0%> (-1.77%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a66546...5dd41e9. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 12, 2018

Codecov Report

Merging #13594 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
components/button/button.tsx 93.4% <100%> (ø) ⬆️
components/upload/UploadList.tsx 88.49% <0%> (-1.77%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a66546...c0d20fc. Read the comment docs.

@@ -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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zombieJ @chenshuai2144

这里 ci 直接没用了。

Copy link
Member

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 加上去。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants