mirror of
https://github.com/nextcloud/server.git
synced 2026-02-24 18:37:44 -05:00
fix(files): Prevent file list from jumping when selecting visible files
Skip scrolling when a file is clicked if it's already within the visible viewport, avoiding the confusing list jump behavior. Fixes #54700 Signed-off-by: nfebe <fenn25.fn@gmail.com>
This commit is contained in:
parent
9def7a8ba7
commit
f296e5e652
1 changed files with 7 additions and 0 deletions
|
|
@ -336,6 +336,13 @@ export default defineComponent({
|
|||
return
|
||||
}
|
||||
|
||||
// Skip scrolling if the target index is already visible
|
||||
const lastVisibleIndex = this.index + (this.visibleRows * this.columnCount) - 1
|
||||
if (index >= this.index && index <= lastVisibleIndex) {
|
||||
logger.debug('VirtualList: Skip scrolling, index already visible', { index })
|
||||
return
|
||||
}
|
||||
|
||||
// Check if the content is smaller (not equal! keep the footer in mind) than the viewport
|
||||
// meaning there is no scrollbar
|
||||
if (this.totalRowCount < this.visibleRows) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue