Skip to content

Commit f3dd25f

Browse files
artongenextcloud-command
authored andcommitted
fix(files): Do not jump to top when fileId is set to currentFolder
Fix #48545 Signed-off-by: Louis Chemineau <louis@chmn.me> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent 749b6f3 commit f3dd25f

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

apps/files/src/components/FilesListVirtual.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ export default defineComponent({
268268
269269
scrollToFile(fileId: number|null, warn = true) {
270270
if (fileId) {
271+
// Do not uselessly scroll to the top of the list.
272+
if (fileId === this.currentFolder.fileid) {
273+
return
274+
}
275+
271276
const index = this.nodes.findIndex(node => node.fileid === fileId)
272277
if (warn && index === -1 && fileId !== this.currentFolder.fileid) {
273278
showError(this.t('files', 'File not found'))

dist/files-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)