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] Does not align properly when it targets a long text with overlap="circular" #43520

Open
vignesh070801 opened this issue Aug 29, 2024 · 2 comments
Labels
customization: css Design CSS customizability enhancement This is not a bug, nor a new feature v7.x

Comments

@vignesh070801
Copy link

vignesh070801 commented Aug 29, 2024

Steps to reproduce

Link to live example: (required) https://codesandbox.io/p/sandbox/gifted-river-35qwxk?file=%2Fsrc%2FDemo.tsx%3A4%2C1

Steps:

  1. Enclose badge over a long text with overlap="circular"
Testing VERY LONG TEsT

Current behavior

image

Expected behavior

Badge to be at corner of the wrapped text

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
Chrome

Search keywords: Badge long text

@vignesh070801 vignesh070801 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 29, 2024
@siriwatknp
Copy link
Member

siriwatknp commented Aug 30, 2024

A workaround is to override the badge slot CSS right: 0 using sx prop:

<Badge color="secondary" overlap="circular" badgeContent="5" slotProps={{ badge: { sx: { right: 0}}}}>
  Testing VERY LONG TEsT
</Badge>

@siriwatknp siriwatknp added customization: css Design CSS customizability v7.x enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 30, 2024
@vignesh070801
Copy link
Author

But then it works like overlap = "rectangular" which is the default behaviour , right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customization: css Design CSS customizability enhancement This is not a bug, nor a new feature v7.x
Projects
None yet
Development

No branches or pull requests

2 participants