Skip to content

Expand without select #289

Discussion options

You must be logged in to vote

Thank you for the reply. Your notes made me dive deeper and i actually went another route for this as i was also using renderItemArrow.
I noticed that the onClick from arrowProps has an actions.selectItem() by default (https://vscode.dev/github/lukasbach/react-complex-tree/blob/main/packages/core/src/treeItem/useTreeItemRenderContext.ts#L187-L188). I just changed that implementation to:

renderItemArrow={({ item, context }) => renderItemIcons( item, { ...context, arrowProps: { ...context.arrowProps, onClick: () => context.toggleExpandedState() } } )}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bogdancalmutchi
Comment options

Answer selected by bogdancalmutchi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants