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

Comments

Projects
None yet
5 participants
@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

@khayalan-mathew

This comment has been minimized.

Contributor

khayalan-mathew 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 :)

@khayalan-mathew

This comment has been minimized.

Contributor

khayalan-mathew 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

This comment has been minimized.

zikills commented Feb 15, 2018

khayalan-mathew added a commit to khayalan-mathew/ant-design that referenced this issue Feb 15, 2018

@khayalan-mathew khayalan-mathew referenced this issue Feb 15, 2018

Merged

fix issue #9359 #9364

6 of 6 tasks complete
@khayalan-mathew

This comment has been minimized.

Contributor

khayalan-mathew 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 (#9364)
* fix issue #9359

* fix trailing whitespaces

zheeeng added a commit to zheeeng/ant-design that referenced this issue Apr 12, 2018

fix issue ant-design#9359 (ant-design#9364)
* fix issue ant-design#9359

* fix trailing whitespaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment