Skip to content

Tree View - allow for more control of underlying Tree View List Items #11893

@florkbr

Description

@florkbr

Is this a new component or an extension of an existing one?
Tree View/Tree View List Item

The issue
While working on adopting the Tree View into our UI, we noticed it is not possible to "disable" items in the tree (specifically for non-checkbox tree view items).

For our particular use case, the "disabled" item behavior would be to set the pf-v6-u-text-color-disabled text class and prevent clicking/selecting on the item. However it would still be possible to expand the item (if it has children that are not also disabled).

Since the tree view DOM is created only when the menu is open and the DOM is expanded, we don't really have many options for a work-around either (searching the DOM for IDs and setting styles, etc).

Describe the feature

This feature could be implemented by adding a disabled optional prop for the list items (perhaps pulled from the data item), however a longer term solution might be to give more flexibility to using custom list item components in the Tree View like we do elsewhere (see https://www.patternfly.org/extensions/data-view/overview).

Are there visuals for this feature? If applicable, please include examples for each state and for varying widths
Example of what we need (modified in the PF example; Application 2 is "disabled"):

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions