Skip to content

Node Item lost its own state when the tree get focused for the first time #3081

Open
@lyy011lyy

Description

@lyy011lyy

In our project, the Tree node item has its own icon and status to show a dropdown menu .
When user hover the node, the icon shows up and when user click it, it will show the dropdown menu.

But we found that when user click the icon for the first time, the whole tree will refresh itself, and the hover icon will disappear. And user will have to move the mouse out and back to click the icon again to make the dropdown show up.
sldstree refresh

We have tried to set the onClick method to prevent the selection event propagating but it doesn't work...
After debugging, we found the first click trigger the [handleSelect](https://github.com/salesforce/design-system-react/blob/master/components/tree/index.jsx#L205) event of the tree. But it's weird that the event type is onFocus while the property fromFocus is undefined.

Screen Shot 2022-11-21 at 2 52 46 PM

So we are thinking can we introduce a new property to prevent or configure the onFocus event so that the tree will not refresh. This will help a lot on some complicated tree, whose tree item has its own status.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions