diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-01-31 20:11:58 +0100 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-02-09 01:06:42 +0100 |
commit | 99bc452675fdb26fdf983c383bce0b42682ef521 (patch) | |
tree | f1e33830b374fdcc5df9b0b8c414cc6c8e616412 /apps/files | |
parent | d7d1bb6c80bf4878f6822c1b8f6de5bdb6da70c6 (diff) | |
download | nextcloud-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.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 |