Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/prefill.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down