Immediate loading of more results without user scrolling (patch included)

Created on 4 April 2021, about 3 years ago
Updated 14 March 2024, 4 months ago

Problem/Motivation

We use this module on a travel site and it works great on most pages.
We use the Infinite Scroll Pager option with Automatically Load Content ticked.

On some pages however, for reasons we don't understand, the module immediately initiates the loading of the next page of Views results even before the user has scrolled or moved their mouse cursor.
Then when the next page is loaded, it continues to load another Views page, and another, and another, until all pages are loaded.
All the time the user makes no mouse gesture whatsoever.
The screen does not auto-scroll either while additional results are auto-loaded.

Steps to reproduce

We were unable to reliably pinpoint under what exact conditions this happens. We just know it does, sometimes.
Debugging the JS we found that the top of the pager element, pager.offset().top, expressed in pixels was always the same low number (294px), page after page, after page. This would explain why the auto-loading never stops.

Proposed resolution

We found that by removing one line from the js/infinite-scroll.js file, the module started behaving as expected on ALL our pages that have infinite scroll.
Patch attached to the comment below.

πŸ› Bug report
Status

Postponed: needs info

Version

2.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia RdeBoer Melbourne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Is this still an issue with 2.0.x? If yes, please update the version and set the status active again with clear steps or (best) with a test showing what's broken. In this case it might require a reroll as MR.
    2.0.x is the active development branch.

    If nobody replies, we should assume this is fixed and close this issue outdated.

    Thanks!

  • πŸ‡ΊπŸ‡¦Ukraine Bobik

    The issue is relevant in version 2.0.x. Fixed the bug using the patch in #8 and the CSS in #10.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Please prepare a MR against 2.0.x and also see the related issues. Perhaps that should be better solved combined.

    Adding this to the META issue for that reason.

  • πŸ‡ΊπŸ‡ΈUnited States briangervais

    The patch in #8 fixed the issue for us. The CSS in #10 wasn't needed in our case.

Production build 0.69.0 2024