Fixed bug when initializing at at low indices introduced last commit

merge-notes
isark 2 years ago
parent 5bcaa47008
commit b2e7947fb3

@ -131,8 +131,7 @@ export class CarouselComponent<T> implements OnInit, AfterViewInit {
setIndex(slideIndex: number) {
this.current = slideIndex;
for(let i = -this.numExtraPrev(); i <= this.numExtraNext(); i++) {
console.log("adding slide:", this.current + i);
for(let i = Math.max(-this.numExtraPrev(), 0); i <= this.numExtraNext(); i++) {
this.visibleSlides?.push({
index: this.current + i,
hasBeenVisible: false,

Loading…
Cancel
Save