From f296e5e652fc1140c8a356fc3013ba36730e6d0c Mon Sep 17 00:00:00 2001 From: nfebe Date: Thu, 5 Feb 2026 02:45:57 +0100 Subject: [PATCH] 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 --- apps/files/src/components/VirtualList.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/files/src/components/VirtualList.vue b/apps/files/src/components/VirtualList.vue index c64654b1349..e84cf4a0b0e 100644 --- a/apps/files/src/components/VirtualList.vue +++ b/apps/files/src/components/VirtualList.vue @@ -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) {