Skip to content

Commit

Permalink
TreeView: Performance improvements (#2523)
Browse files Browse the repository at this point in the history
* Prevent focus event from bubbling to parent items

* Update scroll story

* Create violet-plants-sip.md

* Ignore lint error

* Update stress test

* Lift styles to root

* Remove unused imports

* Remove unused sx prop

* Clean up styles

* Create tidy-olives-know.md

* Update warning and prefix classnames with PRIVATE_

* Replace VisuallyHidden styled-component

* Use VisuallyHidden component for root level live region

* Update warning

* Style directory icon without styled-components

* Remove sx prop from item

* Disable chromatic on TreeView stress test
  • Loading branch information
colebemis committed Nov 3, 2022
1 parent c326777 commit 50ed644
Show file tree
Hide file tree
Showing 3 changed files with 238 additions and 178 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-olives-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

TreeView: Performance improvements
3 changes: 1 addition & 2 deletions src/TreeView/TreeView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ export const StressTest: Story = () => {
</TreeView.LeadingVisual>
Directory {index}
<TreeView.SubTree>
{Array.from({length: 100}).map((_, index) => (
{Array.from({length: 1000}).map((_, index) => (
<TreeView.Item key={index}>
<TreeView.LeadingVisual>
<FileIcon />
Expand All @@ -623,7 +623,6 @@ export const StressTest: Story = () => {
}

StressTest.parameters = {
// disables Chromatic's snapshotting on a story level
chromatic: {disableSnapshot: true}
}

Expand Down

0 comments on commit 50ed644

Please sign in to comment.