Nmc/5325 file list shows empty when switching between grid and list view#478
Open
suet-kei-chan wants to merge 2 commits into
Open
Conversation
The .files-list element is the actual scroll container (confirmed via DOM inspection — scrollTop > 0 on .files-list when scrolled, not on window or #app-content-vue). When switching between list and grid view, the virtual scroll does not automatically recalculate visible rows for the new item sizes, leaving a blank screen until the user manually scrolls. Fix: watch for files-list--grid class changes on .files-list via MutationObserver, then dispatch a synthetic scroll event on the same element via setTimeout so CSS has fully reflowed before the event fires. This triggers the virtual scroll to recalculate visible rows at the current position without changing the user's scroll position.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A new function setupGridViewScrollFix() is added which fixes the blank screen issue when switching between list and grid view with many files.
Root cause:
.files-list is both the scroll container and the element that gets the files-list--grid class toggled. When the view switches, the virtual scroll doesn't recalculate which rows to render for the new item sizes, resulting in a blank screen until the user manually scrolls.
Fix: