summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-01-31 20:11:58 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2024-02-10 09:28:48 +0100
commit0a71193436e85be0b3f12e0e6c78108392e0a8bb (patch)
treeb55b45bfbcbcfa8e24da847debbcaf6d9cf6fd82 /apps/files
parent139dfab45a3c548d9b5cf54dec4312531e969aae (diff)
downloadnextcloud-server-0a71193436e85be0b3f12e0e6c78108392e0a8bb.tar.gz
nextcloud-server-0a71193436e85be0b3f12e0e6c78108392e0a8bb.zip
fix(files): Do not scroll if there is no scrolling area
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/src/components/VirtualList.vue5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files/src/components/VirtualList.vue b/apps/files/src/components/VirtualList.vue
index d6508df1032..173fe284d27 100644
--- a/apps/files/src/components/VirtualList.vue
+++ b/apps/files/src/components/VirtualList.vue
@@ -243,6 +243,11 @@ export default Vue.extend({
methods: {
scrollTo(index: number) {
+ const targetRow = Math.ceil(this.dataSources.length / this.columnCount)
+ if (targetRow < this.rowCount) {
+ logger.debug('VirtualList: Skip scrolling. nothing to scroll', { index, targetRow, rowCount: this.rowCount })
+ return
+ }
this.index = index
// Scroll to one row and a half before the index
const scrollTop = (Math.floor(index / this.columnCount) - 0.5) * this.itemHeight + this.beforeHeight