Skip to content

ActionIcon inside Tree Node #6674

Answered by jcubic
jcubic asked this question in Q&A
Discussion options

You must be logged in to vote

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>
  )}/>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jcubic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant