Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lyy011lyy opened this issue Nov 23, 2022 · 2 comments
Open

Comments

@lyy011lyy
Copy link

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!

@welcome
Copy link

welcome bot commented Nov 23, 2022

Thanks for opening your first issue! 👋
If you have found this library helpful, please star it. A maintainer will try to respond within 7 days. If you haven’t heard anything by then, please bump this thread.

@lyy011lyy
Copy link
Author

lyy011lyy commented Nov 29, 2022

Draft PR created (#3083), and I want to discuss on it first, especially whether this is a good way to realize
If the idea is ok, I will follow the instructions to finish the PR.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant