pnp / pnp/sp-dev-fx-controls-react

TreeView - dynamic adding children, nodes always expanded

Open
#643 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs: Attention :wave: type:question
Dominant language
TypeScript
Stars
433
Forks
418
Avg merge
5d 6m
Merged PRs (30d)
19

Description

Category
  • Enhancement

  • Bug

  • Question

Version

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

If I'm using the onExpandCollapse prop to dynamically add ITreeItem children to a node when it's expanded, then each child ITreeItem is added in an "expanded" state, so to drill further down, you need to collapse then expand in order to correctly show children.

Is there any way to add an ITreeItem with an empty children array, such that the new child is a collapsed state so that the new child item can be expanded to further retrieve children dynamically.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the TreeView behavior in version 1.19.0 with the onExpandCollapse prop and dynamically added ITreeItem children. Inspect the TreeView implementation to determine how an empty children array sets expansion state; done means newly added child nodes remain collapsed while still allowing further dynamic expansion.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.