Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(files): Do not scroll if there is no scrolling area
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux authored and skjnldsv committed Feb 10, 2024
commit 0a71193436e85be0b3f12e0e6c78108392e0a8bb
5 changes: 5 additions & 0 deletions apps/files/src/components/VirtualList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down