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
4 changes: 3 additions & 1 deletion components/carousel/carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ export class Carousel extends Component<CarouselOptions> {
this.el.classList.remove('scrolling');
}, this.options.duration);

// Save last center before updating the center for onCycleTo callback
const lastCenter = this.center;

// Start actual scroll
this.offset = typeof x === 'number' ? x : this.offset;
this.center = Math.floor((this.offset + this.dim / 2) / this.dim);
Expand All @@ -496,7 +499,6 @@ export class Carousel extends Component<CarouselOptions> {
zTranslation: number,
tweenedOpacity: number,
centerTweenedOpacity: number;
const lastCenter = this.center;
const numVisibleOffset = 1 / this.options.numVisible;

// delta = this.offset - this.center * this.dim;
Expand Down