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

Badge works wrong in dot mode #9359

Closed
zikills opened this issue Feb 14, 2018 · 4 comments
Closed

Badge works wrong in dot mode #9359

zikills opened this issue Feb 14, 2018 · 4 comments
Assignees

Comments

@zikills
Copy link

@zikills zikills commented Feb 14, 2018

Version

3.2.1

Environment

Windows 10, Chrome 63.0.3239.132, React 16.2.0

Reproduction link

https://codesandbox.io/s/r0qp9o9rko

Steps to reproduce

See example

What is expected?

In DOT mode Dot must not be visible if count == 0 (of course with showZero == False).
When Dot has Count > 9 it starts to grow (horizontally). Since it does not show value it has not have to change its width.

What is actually happening?

Dot is visible also if showZero == False and count == 0
Dot size is changed if count has more than 1 digit

@iammathew
Copy link
Contributor

@iammathew iammathew commented Feb 14, 2018

Looked into it and found the lines, causing the errors:
count > 9 error: https://github.com/ant-design/ant-design/blob/master/components/badge/index.tsx#L79
fix: just add '&& !isDot' as additional requirement for '${prefixCls}-multiple-words'
count = 0 error: https://github.com/ant-design/ant-design/blob/master/components/badge/index.tsx#L71
fix: change ' && !isDot' to '&& !status' (fix is wrong see #9364 for correct solution)

I'm going to fix it and create a PR as soon as i can :)

@iammathew
Copy link
Contributor

@iammathew iammathew commented Feb 15, 2018

fixed the count > 9 error and the count = 0 error, but i'm not sure if the intended behavior of the dot badge is to vanish if count = 0, since dot shouldn't be used simultaneously with count.

@zikills
Copy link
Author

@zikills zikills commented Feb 15, 2018

iammathew added a commit to iammathew/ant-design that referenced this issue Feb 15, 2018
@iammathew iammathew mentioned this issue Feb 15, 2018
6 of 6 tasks complete
@iammathew
Copy link
Contributor

@iammathew iammathew commented Feb 15, 2018

created PR with new behavior, which shouldn't break any existing badges.

@afc163 afc163 closed this Feb 24, 2018
afc163 added a commit that referenced this issue Feb 24, 2018
* fix issue #9359

* fix trailing whitespaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants