diff --git a/src/prefill.js b/src/prefill.js index 292c75d4..aea6acc3 100644 --- a/src/prefill.js +++ b/src/prefill.js @@ -22,6 +22,16 @@ export default class Prefill { } _prefillNext() { + // Respect the loadOnScroll flag. When trigger mode is active, + // Trigger.bind() calls disableLoadOnScroll() during the BINDED event, + // which fires before prefill runs. Without this guard, prefill would + // call next() unconditionally and bypass trigger mode, causing an + // unexpected auto-load on reload when the scroll position is restored + // near the sentinel. See: https://github.com/webcreate/infinite-ajax-scroll/issues/886 + if (!this.ias.loadOnScroll) { + return; + } + let distance = this.ias.distance(); if (distance > 0) {