Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit 7fda78a

Browse files
committed
Fix border for variable height nodes.
Making the hode a flex item does not show performance penalty.
1 parent 607db6b commit 7fda78a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

packages/devtools-components/src/tree.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
display: block;
2727
}
2828

29+
.tree .tree-node {
30+
display: flex;
31+
}
32+
2933
.tree-indent {
3034
display: inline-block;
3135
width: 12px;

packages/devtools-components/stories/tree.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ storiesOf("Tree", module)
3838
expanded: new Set(["A"])
3939
});
4040
})
41+
.add("variable height nodes", () => {
42+
const nodes = Array.from({length: 10})
43+
.map((_, i) => `item ${i + 1} - `.repeat(10 + Math.random() * 50));
44+
return renderTree({
45+
getRoots: () => ["ROOT"],
46+
expanded: new Set(["ROOT"])
47+
}, {
48+
children: {"ROOT": nodes}
49+
});
50+
})
4151
.add("scrollable tree", () => {
4252
const nodes = Array.from({length: 500}).map((_, i) => (i + 1).toString());
4353

0 commit comments

Comments
 (0)