Skip to content

Commit

Permalink
fix(files): Do not jump to top when fileId is set to currentFolder
Browse files Browse the repository at this point in the history
Fix #48545

Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
  • Loading branch information
artonge authored and nextcloud-command committed Oct 29, 2024
1 parent 749b6f3 commit a77dd3e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions apps/files/src/components/FilesListVirtual.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

0 comments on commit a77dd3e

Please sign in to comment.