[Treeview] Node selection support
See original GitHub issueThanks very much for the release of the brand new TreeView component! ❤️ I’d like to request a basic feature for the Treeview component to emit an event when any node is selected.
You may have already planned this, but I couldn’t find any information for it, hence the request.
- This is not a v0.x issue.
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior 🤔
A node selected event fired when a node is selected or focused.
Current Behavior 😯
No event is fired at node selection, onNodeToggle
event doesn’t fire for leaf nodes, onClick event can be attached to each TreeItem as a workaround, however it doesn’t support keyboard action.
Examples 🌈
- https://demos.telerik.com/kendo-ui/treeview/index
- https://ej2.syncfusion.com/react/demos/#/material/treeview/multiple-selection
- https://www.jqwidgets.com/react/react-tree/index.htm#https://www.jqwidgets.com/react/react-tree/react-tree-defaultfunctionality.htm
- https://js.devexpress.com/Demos/WidgetsGallery/Demo/TreeView/HierarchicalDataStructure/React/Light/
- https://www.primefaces.org/primeng/#/tree
- https://docs.sencha.com/extjs/7.0.0/guides/components/trees.html
- https://www.igniteui.com/tree/overview
- https://www.jqueryscript.net/demo/Tree-Plugin-jQuery-jsTree/
- https://github.com/mar10/fancytree
Context 🔦
I’m implementing something where the rest of the UI needs to be updated according to the selection of the node. This is a much needed feature.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:32 (20 by maintainers)
Top Results From Across the Web
[Treeview] Node selection support #16795 - mui/material-ui
I'd like to request a basic feature for the Treeview component to emit an event when any node is selected. You may have...
Read more >Treeview node selection in UI for WinForms | Telerik Forums
Hi, I have problems with with Q2 2011 : - every node of a treeview in my application is selectable not only by...
Read more >How do I programmatically select a node in a TreeView control?
This FAQ explains the topic " How do I programmatically select a node in a TreeView control? ". You can submit your questions...
Read more >TreeNode.Selected Property (System.Web.UI.WebControls)
The following code example demonstrates how to use the Selected property to select a node in the TreeView control. ASP.NET (C#) Copy.
Read more >TreeView Node Selection - SAPIEN ... - SAPIEN Technologies
TreeView Node Selection. Ask your PowerShell-related questions, including questions on cmdlet development! Forum rules. Do not post any ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What about using the existing
onFocus
prop?On a similar topic, I would propose the introduction of a
component
prop to theTreeItem
component. People should be able to render a link or a button, something that would handle the click, enter keyboard events natively.cc @joshwooding
Hi,
I was wondering what the status of this was? Right now when a user clicks, the color changes for the background of the selected. However, when you click anywhere outside the previous selected item gets deselected. Is there a way to prevent the deselect unless it another tree item gets selected.
When element is selected:
When you select anywhere outside the tree, the white selection gets deselected.
Right now i’m leveraging off the
As a workaround, I could probably create an internal state to manage what is selected, and then apply my own style. Wonder if there is any easier way to do. this thou?
Thanks, Derek