Skip to content

[Bug]: Tag size prop is overridden by parent component's size #19388

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

Open
2 tasks done
kcpru opened this issue May 15, 2025 · 0 comments · May be fixed by #19406
Open
2 tasks done

[Bug]: Tag size prop is overridden by parent component's size #19388

kcpru opened this issue May 15, 2025 · 0 comments · May be fixed by #19406

Comments

@kcpru
Copy link

kcpru commented May 15, 2025

Package

@carbon/react

Browser

No response

Package version

v1.82.1

React version

No response

Description

When using the <Tag> component with a size prop, the size gets overridden if the parent component also has a size prop. This makes it impossible to set a different size for the <Tag>

Image

Reproduction/example

https://stackblitz.com/edit/github-lshfjdex?file=src%2FApp.tsx&preset=node=

Steps to reproduce

  1. Create <Button size="xl">
  2. Inside it, add <Tag size="sm">
  3. <Tag> appears with size xl instead of sm

Suggested Severity

None

Application/PAL

No response

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant