Skip to content

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

@kcpru

Description

@kcpru

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions