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

TreeView: defaultExpanded: true doesn't work #560

Closed
1 of 3 tasks
AJIXuMuK opened this issue May 15, 2020 · 3 comments
Closed
1 of 3 tasks

TreeView: defaultExpanded: true doesn't work #560

AJIXuMuK opened this issue May 15, 2020 · 3 comments
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:enhancement New feature or enhancement of existing capability
Milestone

Comments

@AJIXuMuK
Copy link
Collaborator

Category

  • Enhancement
  • Bug
  • Question

Version

Please specify what version of the library you are using: [1.18.0]

Expected / Desired Behavior / Question

Setting defaultExpanded property to true opens all the nodes of the TreeView

Observed Behavior

There is no difference in behavior between false and true

Steps to Reproduce

const treeitems = [
    {
      key: "R1",
      label: "Root",
      subLabel: "This is a sub label for node",
      iconProps: this.skypeCheckIcon,
      actions: [{
        title: "Get item",
        iconProps: {
          iconName: 'Warning',
          style: {
            color: 'salmon',
          },
        },
        id: "GetItem",
        actionCallback: async (treeItem: ITreeItem) => {
          console.log(treeItem);
        }
      }],
      children: [
        {
          key: "1",
          label: "Parent 1",
          selectable: false,
          children: [
            {
              key: "3",
              label: "Child 1",
              subLabel: "This is a sub label for node",
              actions: [{
                title: "Share",
                iconProps: {
                  iconName: 'Share'
                },
                id: "GetItem",
                actionCallback: async (treeItem: ITreeItem) => {
                  console.log(treeItem);
                }
              }],
              children: [
                {
                  key: "gc1",
                  label: "Grand Child 1",
                  actions: [{
                    title: "Get Grand Child item",
                    iconProps: {
                      iconName: 'Mail'
                    },
                    id: "GetItem",
                    actionCallback: async (treeItem: ITreeItem) => {
                      console.log(treeItem);
                    }
                  }]
                }
              ]
            },
            {
              key: "4",
              label: "Child 2",
              iconProps: this.skypeCheckIcon
            }
          ]
        },
        {
          key: "2",
          label: "Parent 2"
        },
        {
          key: "5",
          label: "Parent 3",
          disabled: true
        },
        {
          key: "6",
          label: "Parent 4",
          selectable: true
        }
      ]
    },
    {
      key: "R2",
      label: "Root 2",
      children: [
        {
          key: "8",
          label: "Parent 5"
        }
      ]
    }
  ];

return <TreeView items={treeitems}
            defaultExpanded={true}
            selectionMode={TreeViewSelectionMode.Multiple}
            showCheckboxes={true}
            treeItemActionsDisplayMode={TreeItemActionsDisplayMode.ContextualMenu}
            defaultSelectedKeys={['R2', 'gc1']}
            onExpandCollapse={this.onExpandCollapseTree}
            onSelect={this.onItemSelected}
          // onRenderItem={this.renderCustomTreeItem}
          />

tree-view-default-expanded

@ghost
Copy link

ghost commented May 15, 2020

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label May 15, 2020
@AJIXuMuK AJIXuMuK added status:tracked Triaged and are being investigated further type:enhancement New feature or enhancement of existing capability and removed Needs: Triage 🔍 labels May 15, 2020
@nanddeepn
Copy link
Contributor

Me and @siddharth-vaghasia will look in to this.

@saurav2107
Copy link

I am still facing this issue, though i started from version 1.19.0 is this fix available in the release 1.19.0 or planned for next releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:enhancement New feature or enhancement of existing capability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants