Skip to content

Commit c79368f

Browse files
committed
fix(files): Do not jump to top when fileId is set to currentFolder
Fix #48545 Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent 0b5f036 commit c79368f

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

apps/files/src/components/FilesListVirtual.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ export default defineComponent({
252252
253253
scrollToFile(fileId: number|null, warn = true) {
254254
if (fileId) {
255+
// Do not uselessly scroll to the top of the list.
256+
if (fileId === this.currentFolder.fileid) {
257+
return
258+
}
259+
255260
const index = this.nodes.findIndex(node => node.fileid === fileId)
256261
if (warn && index === -1 && fileId !== this.currentFolder.fileid) {
257262
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)