Fix scrolling after switching to grid view #16798
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #16510
Switching to grid view from list view can break the scrolling and fail to load more files. In this situation, only the files that were visible in list view are initially displayed. In a large enough browser window and/or high enough screen resolution, this could mean a lot of empty space on the page, and scrolling to load the rest of the files is broken/not possible.
To solve this, I used the same solution that currently exists when toggling hidden files:
server/apps/files/js/filelist.js
Lines 272 to 275 in e51c269
One question though: I'm stepping into the Nextcloud code for the first time. When searching the code, I found the same
onGridViewChangefunction here, but I have no idea what this file does. It doesn't seem to implement theon_scrollfunction so the fix can't be applied here anyway. So I assume no changes are needed here?server/core/src/OC/dialogs.js
Line 922 in 265a284