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

[Bug Report] v-badge icon is not centered #12083

Closed
ghost opened this issue Aug 20, 2020 · 5 comments
Closed

[Bug Report] v-badge icon is not centered #12083

ghost opened this issue Aug 20, 2020 · 5 comments
Assignees
Labels
C: VBadge VBadge has workaround T: bug Functionality that does not work as intended/expected
Milestone

Comments

@ghost
Copy link

ghost commented Aug 20, 2020

Environment

Vuetify Version: 2.3.9
Vue Version: 2.6.11
Browsers: Firefox 79.0
OS: Ubuntu 20.04

Steps to reproduce

Set the icon prop on a v-badge component

Expected Behavior

Icon is centered on badge

Actual Behavior

Icon is leaned towards the bottom and not centered

Reproduction Link

https://codepen.io/caesarivs/pen/zYqKJwz

@ghost ghost added the S: triage label Aug 20, 2020
@Mert75 Mert75 added C: VBadge VBadge T: bug Functionality that does not work as intended/expected and removed T: bug Functionality that does not work as intended/expected S: triage labels Aug 22, 2020
@ElSamhaa
Copy link

ElSamhaa commented Aug 31, 2020

not just v-badge actually, all pressable icons (at least) are not perfectly centered relative to its circle nor ripple. I've measured its proportions in many different symmetric icons (e.g. plus, minus, ...) and found out they are deviated by 1-2px.

@ghost
Copy link
Author

ghost commented Aug 31, 2020

@ElSamhaa I don't think all icons:

<v-btn icon>
  <v-icon>mdi-circle</v-icon>
</v-btn>

Renders a centered circle, I've updated the codepen to reflect this, since that's kind of the expected output with the badge component.

@ghost
Copy link
Author

ghost commented Aug 31, 2020

I've found a workaround:

Using the badge slot and centering the icon using flexbox.

Codepen is updated showing this approach

@nekosaur
Copy link
Member

In v3 the icon is positioned using align-items: center and justify-content: center inside the badge.

@nekosaur nekosaur added this to the v3.0.0 milestone Mar 24, 2021
@KaelWD KaelWD modified the milestones: v3.0.0, v3.0.x Nov 1, 2022
@KaelWD
Copy link
Member

KaelWD commented Nov 1, 2022

Broken again by bc7d409

@KaelWD KaelWD modified the milestones: v3.0.x, v3.1.x Jan 6, 2023
@johnleider johnleider self-assigned this Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VBadge VBadge has workaround T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

5 participants