mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(files): Do not scroll if there is no scrolling area
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
d7d1bb6c80
commit
99bc452675
1 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue