Skip to content

Commit 6e72b2e

Browse files
committed
fix(files): Do not scroll if there is no scrolling area
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 70bb982 commit 6e72b2e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/files/src/components/VirtualList.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,11 @@ export default Vue.extend({
243243
244244
methods: {
245245
scrollTo(index: number) {
246+
const targetRow = Math.ceil(this.dataSources.length / this.columnCount)
247+
if (targetRow < this.rowCount) {
248+
logger.debug('VirtualList: Skip scrolling. nothing to scroll', { index, targetRow, rowCount: this.rowCount })
249+
return
250+
}
246251
this.index = index
247252
// Scroll to one row and a half before the index
248253
const scrollTop = (Math.floor(index / this.columnCount) - 0.5) * this.itemHeight + this.beforeHeight

0 commit comments

Comments
 (0)