Skip to content

[Bug]: TreeNode to support truncation when label text gets too big, consider integrating <Tooltip> within TreeNode #18919

@2nikhiltom

Description

@2nikhiltom

Package

@carbon/react

Browser

No response

Package version

v11.78.0

React version

No response

Description

  1. Label text does not get truncated in treeview/treeNode

  2. The component does not have tooltips integrated within it (like -IconButton, ContentSwitcher with icons, CopyButton, Slider )
    Image

Reproduction/example

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

Steps to reproduce

Pass a really long label to TreeNode
Note:
A workaround is to pass a Tooltip in a label - so that label is displayed inside of a tooltip but here too no truncation happens

 <TreeNode
            key="1"
            id="1"
            value="Artificial intelligence"
            label={
              <span>
                this does not truncate : Artificial intelligence Artificial
                intelligenceArtificial intelligenceArtificial
                intelligenceArtificial intelligenceArtificial
                intelligenceArtificial intelligenceArtificial
                intelligenceArtificial intelligenceArtificial
                intelligenceArtificial intelligenceArtificial
                intelligenceArtificial intelligenceArtificial
                intelligenceArtificial intelligenceArtificial
                intelligenceArtificial intelligenceArtificial
                intelligenceArtificial intelligenceArtificial
                intelligenceArtificial intelligence
              </span>
            }
          />
Image

Suggested Severity

Severity 2 = User cannot complete task, and/or no workaround within the user experience of a given component.

Application/PAL

No response

Code of Conduct

Metadata

Metadata

Assignees

Type

Projects

Status

🚦 In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions