Skip to content

[Bug]: Tooltip autoAlign cause performance problem on window resize #21026

@axelhzf

Description

@axelhzf

Package

@carbon/react

Browser

Chrome

Package version

1.95.0

React version

19.0.2

Description

When there are many Tooltip component using autoAlign on a page, the page experiences significant performance degradation during window resize events.

Possible Cause

The floating-ui's autoUpdate is being called on every tooltip even if they are not open. In theory, that should be handled by the whileElementsMounted, but the problem is that the PopOver component is not unmounting the floating component when it's closed.

Reproduction/example

https://stackblitz.com/edit/github-o2gbmkzq?file=src%2FApp.tsx

Steps to reproduce

  1. Create a page with many components that include Carbon tooltips using autoAlign (e.g., 100+ tooltips)
  2. Resize the window
  3. Observe the page performance

Suggested Severity

Severity 4 = Unrelated to a user task, has a workaround or does not need a workaround.

Application/PAL

Quantum

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions