diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-01-31 20:11:58 +0100 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2024-02-10 09:28:48 +0100 |
commit | 0a71193436e85be0b3f12e0e6c78108392e0a8bb (patch) | |
tree | b55b45bfbcbcfa8e24da847debbcaf6d9cf6fd82 /apps/files | |
parent | 139dfab45a3c548d9b5cf54dec4312531e969aae (diff) | |
download | nextcloud-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.vue | 5 |
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 |