Skip to content

Commit

Permalink
Merge pull request #48979 from nextcloud/backport/48632/stable30
Browse files Browse the repository at this point in the history
[stable30] fix(files): Do not jump to top when fileId is set to currentFolder
  • Loading branch information
artonge authored Oct 29, 2024
2 parents 9c02abb + 592cdd9 commit 6099298
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 @@ -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'))
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 6099298

Please sign in to comment.