Skip to content

Commit

Permalink
refactor(esl-carousel): fix jumping during commit animation
Browse files Browse the repository at this point in the history
  • Loading branch information
julia-murashko committed Feb 7, 2024
1 parent 0bb5eda commit dee4dfb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class ESLMultiCarouselRenderer extends ESLCarouselRenderer {
const slideSize = this.slideSize + this.gap;
// calculate offset to move to
const shiftCount = Math.abs(offset) % slideSize >= slideSize / 4 ? 1 : 0;
const stageOffset = offset < 0 ? -shiftCount * slideSize : (shiftCount - 1) * slideSize - this.gap;
const stageOffset = offset < 0 ? -shiftCount * slideSize : (shiftCount - 1) * slideSize;

this.$carousel.toggleAttribute('animating', true);
this.setTransformOffset(stageOffset);
Expand Down

0 comments on commit dee4dfb

Please sign in to comment.