aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2024-10-09 18:23:58 +0200
committerskjnldsv <skjnldsv@protonmail.com>2024-10-29 11:43:03 +0100
commit7b27d052ade86651a1503650ba8e372ebe960e6a (patch)
tree3454bd65844ac57fd339d4e05b8e749372cac3c1 /apps
parent11f0b0f817ff00dd7070d1ecd7adc3bea308914c (diff)
downloadnextcloud-server-7b27d052ade86651a1503650ba8e372ebe960e6a.tar.gz
nextcloud-server-7b27d052ade86651a1503650ba8e372ebe960e6a.zip
fix(files): Do not jump to top when fileId is set to currentFolderartonge/fix/file_list_jump_on_viewer_close
Fix https://github.com/nextcloud/server/issues/48545 Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/src/components/FilesListVirtual.vue5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue
index 035d4702e32..95bd0f6c571 100644
--- a/apps/files/src/components/FilesListVirtual.vue
+++ b/apps/files/src/components/FilesListVirtual.vue
@@ -252,6 +252,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'))