Module works for desktop but not in mobile screens.

Created on 10 December 2024, 4 months ago

Module works for desktop but not in mobile screens.

I am using this module in view, it is working smoothly for desktop. But in mobile screen, contents not get load after reaching at bottom. Maybe it is not able to fetch scroll position properly in mobile view.

Instead of pageYoffset, we can use any other alternative.

💬 Support request
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India sagarb17

Live updates comments and jobs are added and updated live.
  • mobile

    Issue related to Drupal on mobile devices.

Sign in to follow issues

Comments & Activities

  • Issue created by @sagarb17
  • 🇺🇦Ukraine oleksandr p. Lutsk

    Faced with a similar issue on my project.

    After a little investigation, I found incorrect triggering of the scroll event on the mobile devices, because this event was missed from the general event list.
    Fixed by changing the "scroll" event to "touchmove".
    Something like that:

    // Trick to fix the infinite scroll on mobile devices.
    if (window.innerWidth <= 992) {
      scrollEvent = 'touchmove';
    }
    

    Hope, my comment will be helpful to someone)

  • I tested this on my local setup with Drupal 11 and PHP 8.3, using the Infinite Scroll module in a View. I also tested it on a mobile emulator, and the scrolling behavior worked as expected—content loads correctly while scrolling on mobile.

    To help debug this further, could you please provide exact steps to reproduce the issue? Specifically:

    Drupal version and PHP version you're using.
    Any custom configurations in the View (e.g., caching settings, exposed filters, pager settings).
    Whether the issue happens on specific mobile devices or all mobile browsers.
    If any JavaScript errors appear in the browser console when scrolling on mobile.

    Let me know if you spot any differences or if there's anything specific..

  • 🇮🇳India kulpratap2002

    I also tested this on my local setup with Drupal 11 and PHP 8.3, using the Infinite Scroll module in a View. I also tested it on a mobile emulator, and the scrolling behavior worked as expected, with +1 to #3.

    Attaching video for reference.
    Thank you.

Production build 0.71.5 2024