Skip to content

Fix grid view jumping horizontally on lazy load#1

Merged
RicoUHD merged 1 commit intomasterfrom
fix-files-grid-jump-9919727321702578234
Apr 9, 2026
Merged

Fix grid view jumping horizontally on lazy load#1
RicoUHD merged 1 commit intomasterfrom
fix-files-grid-jump-9919727321702578234

Conversation

@RicoUHD
Copy link
Copy Markdown
Owner

@RicoUHD RicoUHD commented Apr 9, 2026

Fixes a bug where Nextcloud Files app Grid view shifts left horizontally by one icon position whenever a user scrolls down and lazy loads a new row of items. We updated VirtualList.vue to base grid calculations explicitly on the inner clientWidth tracking the inner body and then forcing the exact matched template columns in the DOM.


PR created automatically by Jules for task 9919727321702578234 started by @RicoUHD

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>
Repository owner deleted a comment from google-labs-jules bot Apr 9, 2026
@RicoUHD RicoUHD merged commit e781fd9 into master Apr 9, 2026
@RicoUHD RicoUHD deleted the fix-files-grid-jump-9919727321702578234 branch April 9, 2026 19:43
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.

1 participant