Skip to content

Commit

Permalink
fix: fix scrollToNode function by renaming "clusterize-extra-row" to …
Browse files Browse the repository at this point in the history
…"infinite-tree-extra-row" (#63)

Co-authored-by: cheton <[email protected]>
  • Loading branch information
JZacaroli and cheton authored Jul 1, 2022
1 parent 1fcb5c4 commit ebe5b31
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/infinite-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -1492,10 +1492,11 @@ class InfiniteTree extends events.EventEmitter {
}

// Scroll to a desired position
const prefix = 'infinite-tree-';
let firstChild = this.contentElement.firstChild;
while (firstChild) {
const className = firstChild.className || '';
if (className.indexOf('clusterize-extra-row') < 0 && (firstChild.offsetHeight > 0)) {
if (className.indexOf(prefix + 'extra-row') < 0 && (firstChild.offsetHeight > 0)) {
break;
}
firstChild = firstChild.nextSibling;
Expand Down

0 comments on commit ebe5b31

Please sign in to comment.