carbon icon indicating copy to clipboard operation
carbon copied to clipboard

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

Open rcsatheeshkumar opened this issue 1 year ago • 5 comments

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 avatar Aug 20 '24 08:08 rcsatheeshkumar

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.

guidari avatar Aug 20 '24 12:08 guidari

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:

https://github.com/user-attachments/assets/058c02b0-55c6-45a0-aa48-e53686c8e621

p-szalast avatar Aug 22 '24 12:08 p-szalast

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.

guidari avatar Aug 22 '24 17:08 guidari

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 (https://github.com/carbon-design-system/carbon/issues/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

rcsatheeshkumar avatar Aug 22 '24 17:08 rcsatheeshkumar

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:

https://github.com/user-attachments/assets/cbb85bef-840a-42eb-b6cc-1140a0d2423e

thyhmdo avatar Aug 22 '24 17:08 thyhmdo

Can you estimate when this issue will be resolved?

jakubkloc avatar Sep 05 '24 09:09 jakubkloc

Is there any significant progress in this issue?

p-szalast avatar Sep 27 '24 14:09 p-szalast