aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-01-31 20:11:58 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2024-02-09 01:06:42 +0100
commit99bc452675fdb26fdf983c383bce0b42682ef521 (patch)
treef1e33830b374fdcc5df9b0b8c414cc6c8e616412 /apps/files
parentd7d1bb6c80bf4878f6822c1b8f6de5bdb6da70c6 (diff)
downloadnextcloud-server-99bc452675fdb26fdf983c383bce0b42682ef521.tar.gz
nextcloud-server-99bc452675fdb26fdf983c383bce0b42682ef521.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