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

Blueprint renderers don't work with ClickArrowToExpand #3

Closed
floriancargoet opened this issue Aug 31, 2021 · 2 comments
Closed

Blueprint renderers don't work with ClickArrowToExpand #3

floriancargoet opened this issue Aug 31, 2021 · 2 comments
Assignees

Comments

@floriancargoet
Copy link

floriancargoet commented Aug 31, 2021

Describe the bug
When using ClickArrowToExpand and the blueprint renderers, nothing happens when I click the arrow.

To Reproduce
Steps to reproduce the behavior:

  • use the blueprint renderers
  • use ClickArrowToExpand
  • click the arrow to expand
  • observe that it doesn't expand

Expected behavior
The node should expand when clicking on its arrow.

@floriancargoet
Copy link
Author

floriancargoet commented Aug 31, 2021

I believe the fix is to add arrowProps to the icon:

  renderItemArrow: (props) => (
    <ChevronRight
      className={cx(
        Classes.TREE_NODE_CARET,
        props.context.isExpanded
          ? Classes.TREE_NODE_CARET_OPEN
          : Classes.TREE_NODE_CARET_CLOSED
      )}
      // FIX
      {...(props.context.arrowProps as any)}
    />
  ),

I casted as any because ChevronRight specifies children: never in its type whereas HTMLProps<any> defines children.

@lukasbach
Copy link
Owner

Fixed, thanks for the implementation suggestion!

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

2 participants