-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TreeView: Preserve expanded state of nested items (#2538)
* Add failing test * Require id prop on tree items * Create expanded cache * Update expanded state cache * Remove console.log * Add comment about expanded cache * Update comment * Create sour-readers-rescue.md * Update src/TreeView/TreeView.tsx Co-authored-by: Josh Black <joshblack@github.com> * Fix lint errors Co-authored-by: Josh Black <joshblack@github.com>
- Loading branch information
Showing
7 changed files
with
310 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
"@primer/react": patch | ||
--- | ||
|
||
TreeView: Preserve expanded state of nested items when parent item is collapsed. | ||
|
||
**Breaking change** | ||
|
||
`TreeView.Item` and `TreeView.LinkItem` now require an `id` prop: | ||
|
||
```diff | ||
- <TreeView.Item>...</TreeView.Item> | ||
+ <TreeView.Item id="unqiue-id">...</TreeView.Item> | ||
``` | ||
|
||
This is not in a major release because TreeView is still a `draft` component. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.