From f3dd25fa642e958fbafeddefdbec48f7c7d6ea83 Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Wed, 9 Oct 2024 18:23:58 +0200 Subject: fix(files): Do not jump to top when fileId is set to currentFolder Fix https://github.com/nextcloud/server/issues/48545 Signed-off-by: Louis Chemineau Signed-off-by: nextcloud-command --- apps/files/src/components/FilesListVirtual.vue | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apps') diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue index 4f3bdec9fd9..303d57e5326 100644 --- a/apps/files/src/components/FilesListVirtual.vue +++ b/apps/files/src/components/FilesListVirtual.vue @@ -268,6 +268,11 @@ export default defineComponent({ scrollToFile(fileId: number|null, warn = true) { if (fileId) { + // Do not uselessly scroll to the top of the list. + if (fileId === this.currentFolder.fileid) { + return + } + const index = this.nodes.findIndex(node => node.fileid === fileId) if (warn && index === -1 && fileId !== this.currentFolder.fileid) { showError(this.t('files', 'File not found')) -- cgit v1.2.3