Skip to content

[Bug]: AILabel popover links fail to open when component is rendered inside Shadow DOM #21235

@Siddhi132

Description

@Siddhi132

Package

@carbon/react

Browser

All

Package version

1.49.0

React version

No response

Description

Links inside Carbon Design System's AILabel popover content do not work when the component is rendered within a Shadow DOM web component. The popover closes instead of redirecting to that link.

Environment

  • Carbon React Version: 1.49.0
  • Framework: Preact 10.19.3

🎯 Affected Components

This issue affects any interactive content inside AILabel popovers when used in Shadow DOM:

  • Links (<a> tags)
  • Buttons with click handlers
  • Any element with onClick handlers (such as ai label action buttons as well)

Reproduction/example

https://stackblitz.com/edit/vitejs-vite-dbhyutku?file=index.html

Steps to reproduce

  1. Create a web component using preact-custom-element with shadow: true
  2. Render an AILabel component inside the shadow DOM
  3. Add links (<a> tags) inside AILabelContent
  4. Click on any link in the popover
  5. Expected: Link opens in new tab
  6. Actual: Popover closes immediately, link does not open

Suggested Severity

None

Application/PAL

No response

Code of Conduct

Metadata

Metadata

Type

No fields configured for Bug.

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions