Magellan with data-offset does not trigger correctly on the first item #11754
let activeIdx;
// Before the first point: no link
- if(newScrollPos < this.points[0]){ /* do nothing */ }
+ if(newScrollPos < this.points[0] - this.options.offset - (isScrollingUp ? this.options.threshold : 0)){ /* do nothing */ }
// At the bottom of the page: last link
else if(newScrollPos + this.winHeight === this.docHeight){ activeIdx = this.points.length - 1; }
// Otherwhise, use the last visible link