Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/vue-virtual-scroller/src/components/RecycleScroller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,20 @@ export default {
throw new Error('Rendered items limit reached')
},

isAnyVisibleGap () {
// Check if any view index is not in sequence (detect gaps)
return this.pool
.filter(({ nr }) => nr.used)
.every(({ nr }, i) => i === 0 || nr.index !== this.pool[i - 1].index + 1)
},

sortViews () {
this.pool.sort((viewA, viewB) => viewA.nr.index - viewB.nr.index)

if(this.isAnyVisibleGap()) {
this.updateVisibleItems()
clearTimeout(this.$_sortTimer)
}
},
},
}
Expand Down