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

Changing isExpanded props in TreeNode to false doesn't change TreeNode inner state #6788

Closed
1 of 2 tasks
MaciejRusek opened this issue Sep 7, 2020 · 0 comments · Fixed by #6791
Closed
1 of 2 tasks

Comments

@MaciejRusek
Copy link

Changing isExpanded props in TreeNode to false doesn't change TreeNode inner state

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

As TreeView and TreeNode aren't officially released yet I've copied the source code directly to our app.

The problem is with the isExpanded prop. In my scenario, I need the button to collapse all nodes at once. To do so I am using isExpanded prop of the TreeNode component.
Information about the expanded or collapsed node is stored in redux. So when collapse all button is clicked I'm setting isExpanded prop to false. Unfortunately, it doesn't collapse the nodes. Prop changes to the false but the inner state doesn't (see the gif below).

bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants