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 <[email protected]>

[skip ci]
  • Loading branch information
artonge authored and backportbot[bot] committed Oct 29, 2024
1 parent c5a15be commit 03f3bd9
Showing 1 changed file with 5 additions and 0 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

0 comments on commit 03f3bd9

Please sign in to comment.