Skip to content

Fix horizontal grid jumping on lazy load in Vue VirtualList#59549

Open
RicoUHD wants to merge 4 commits intonextcloud:masterfrom
RicoUHD:master
Open

Fix horizontal grid jumping on lazy load in Vue VirtualList#59549
RicoUHD wants to merge 4 commits intonextcloud:masterfrom
RicoUHD:master

Conversation

@RicoUHD
Copy link
Copy Markdown

@RicoUHD RicoUHD commented Apr 9, 2026

Summary

Fixes a visual bug in the Nextcloud Files app where the Grid view shifts left horizontally by one icon position whenever a user scrolls down and lazy-loads a new row of items.

The fix updates VirtualList.vue to base grid calculations explicitly on the inner clientWidth tracking the inner body, which forces the exact matched template columns in the DOM and prevents the grid from jumping.

TODO

  • Add Before/After screenshots (recommended for front-end visual changes)
  • Determine if backports are needed for stable branches

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

RicoUHD and others added 4 commits April 9, 2026 15:28
The virtual list calculation of column counts used to be out of sync with CSS grid in the case where browser scrollbars have inconsistent layouts. This was because `auto-fill` includes scrollbar dimensions, while JS mathematically excluded them relying on the outer container.

By syncing the inner width (clientWidth) without scrollbars in the ResizeObserver and dynamically pushing the calculated columnCount to inline style gridTemplateColumns on the container, the Javascript rendering completely matches the CSS layout engine rendering.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
…78234

Fix grid view jumping horizontally on lazy load
Signed-off-by: Enrico Lehn <enrico.lehn@gmail.com>
@RicoUHD RicoUHD requested review from a team and skjnldsv as code owners April 9, 2026 20:39
@RicoUHD RicoUHD requested review from nfebe and sorbaugh and removed request for a team April 9, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Files app: Grid view shifts icons left when new rows load while scrolling

1 participant