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 with value 0 should use p-badge-no-gutter class #10257

Closed
mnhock opened this issue May 19, 2021 · 0 comments
Closed

Badge with value 0 should use p-badge-no-gutter class #10257

mnhock opened this issue May 19, 2021 · 0 comments
Assignees
Labels
LTS-FIXED-11.4.6 Fixed in PrimeNG LTS 11.4.6 Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@mnhock
Copy link

mnhock commented May 19, 2021

I'm submitting a ... (check one with "x")

[x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior
Badge component do not use p-badge-no-gutter class with values of length 1 in case of the value 0.

Expected behavior
Badge component should use p-badge-no-gutter class for value 0 as well.

This is the code which is not correct for the value 0:

'p-badge-no-gutter': this.value && String(this.value).length === 1,

should be:

'p-badge-no-gutter': this.value !== undefined && String(this.value).length === 1,

Reproduce:

    const value = 0;
    const value1 = 1;
    const value2 = 2;

    console.log(value && String(value).length === 1);   // 0  -> not correct should be true
    console.log(value1 && String(value1).length === 1); // true,
    console.log(value2 && String(value2).length === 1); // true
@yigitfindikli yigitfindikli added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label May 20, 2021
@yigitfindikli yigitfindikli added this to the 12.Future milestone May 20, 2021
@yigitfindikli yigitfindikli self-assigned this May 20, 2021
@yigitfindikli yigitfindikli modified the milestones: 12.Future, 12.0.0-Final Jun 7, 2021
@yigitfindikli yigitfindikli added LTS-FIXED-11.4.6 Fixed in PrimeNG LTS 11.4.6 and removed LTS-PORTABLE labels Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTS-FIXED-11.4.6 Fixed in PrimeNG LTS 11.4.6 Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants