Skip to content

Commit 674d1f4

Browse files
author
Pankaj
committed
scroll top was coming back as 0 after the calulation which was causing the entire list to start re-rending again and entire system hangs if no of nodes in tree are more than 10K
1 parent efc8908 commit 674d1f4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/StickyTree.jsx

+4
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,10 @@ export default class StickyTree extends React.PureComponent {
743743
scrollTop = this.elem.scrollHeight - this.elem.offsetHeight;
744744
}
745745

746+
if (scrollTop === this.state.scrollTop) {
747+
return;
748+
}
749+
746750
let pos;
747751
if (scrollTop > this.state.scrollTop || currNodePos === 0) {
748752
pos = this.forwardSearch(scrollTop, currNodePos);

0 commit comments

Comments
 (0)