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

[Bug]: Treeview - opened node do not remain open even when parent is collapsed and then opened again #17221

Open
2 tasks done
rcsatheeshkumar opened this issue Aug 20, 2024 · 6 comments
Assignees

Comments

@rcsatheeshkumar
Copy link

Package

@carbon/react

Browser

Chrome, Safari, Firefox, Edge

Package version

1.63.2

React version

18.2.0

Description

Have my opened nodes remain open even if their parent is collapsed and then opened again. The nodes should remain in the same open or closed state.

Reproduction/example

https://stackblitz.com/edit/github-3xhbda-38shez?file=src%2FApp.jsx,package.json

Steps to reproduce

  1. Expand node "A"
  2. Then collapse it's parent node "One"
  3. Expand node "One" and node "A" would be in collapsed state.

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Application/PAL

No response

Code of Conduct

@rcsatheeshkumar rcsatheeshkumar changed the title [Bug]: opened node do not remain open even when parent is collapsed and then opened again [Bug]: Treeview - opened node do not remain open even when parent is collapsed and then opened again Aug 20, 2024
@guidari
Copy link
Contributor

guidari commented Aug 20, 2024

Hey @rcsatheeshkumar
Can you check the storybook code to see if you are missing any configuration. Here in the storybook Default variant works as expected.

@p-szalast
Copy link

Hey @rcsatheeshkumar Can you check the storybook code to see if you are missing any configuration. Here in the storybook Default variant works as expected.

Hey @guidari. In the link that you provided opening parent node also opens previously collapsed sub nodes:

Nagranie.z.ekranu.2024-08-22.o.14.31.58.mov

@guidari
Copy link
Contributor

guidari commented Aug 22, 2024

You are right.
I'll check with the team to understand what is the expected behavior! I guess they should always collapse if the parent node is collapsed like it happens in the UIShell, but I'll confirm that.

@rcsatheeshkumar
Copy link
Author

You are right. I'll check with the team to understand what is the expected behavior! I guess they should always collapse if the parent node is collapsed like it happens in the UIShell, but I'll confirm that.

I think it is a bug since in the design spec of TreeView (#5180) it was mentioned that "opened nodes remain open even if their parent is collapsed and then opened again. The nodes should remain in the same open or closed state."

image

@thyhmdo
Copy link
Member

thyhmdo commented Aug 22, 2024

I think it could have been implemented differently here. As default, those sub-nodes should be closed. If the user interacts with the sub-nodes, then closing the parent, those sub-nodes stay as they are.

Here is an example:

Screen.Recording.2024-08-22.at.12.38.50.PM.mov

@jakubkloc
Copy link

Can you estimate when this issue will be resolved?

@emyarod emyarod self-assigned this Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🏗 In Progress
Development

No branches or pull requests

6 participants