-
Is there a way to have ActionIcon or Button inside the Tree Node? Right now, when you add such element to Tree Node, when you click it, it collapse/expand the Branch. I need to add an icon that will create a new child node. |
Beta Was this translation helpful? Give feedback.
Answered by
jcubic
Aug 15, 2024
Replies: 1 comment
-
You can prevent the expanding and do this by hand onClick <Tree
data={data}
levelOffset={23}
expandOnClick={false}
renderNode={({ node, tree, expanded, hasChildren, elementProps }: RenderTreeNodePayload) => (
<Group gap={5} {...elementProps}>
<span onClick={() => tree.toggleExpanded(node.value)}>{node.label}</span>
<ActionIcon><IconFilePlus size={14}/></ActionIcon>
</Group>
)}/> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jcubic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can prevent the expanding and do this by hand onClick