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:
nfebe 2026-02-05 02:45:57 +01:00
parent 9def7a8ba7
commit f296e5e652

View file

@ -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) {