Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
alenaksu authored Oct 17, 2024
1 parent 1ca33be commit cd8495d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/carousel/carousel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default class SlCarousel extends ShoelaceElement {
private autoplayController = new AutoplayController(this, () => this.next());
private readonly localize = new LocalizeController(this);
private mutationObserver: MutationObserver;
private pendingInteraction = false;
private pendingInteractionScroll = false;

connectedCallback(): void {
super.connectedCallback();
Expand Down Expand Up @@ -262,7 +262,7 @@ export default class SlCarousel extends ShoelaceElement {
@eventOptions({ passive: true })
private handleScroll() {
this.scrolling = true;
if (!this.pendingInteraction) {
if (!this.pendingInteractionScroll) {
this.synchronizeSlides();
}
}
Expand Down Expand Up @@ -320,7 +320,7 @@ export default class SlCarousel extends ShoelaceElement {
private handleScrollEnd() {
if (!this.scrolling || this.dragging) return;
this.scrolling = false;
this.pendingInteraction = false;
this.pendingInteractionScroll = false;
this.synchronizeSlides();
}

Expand Down Expand Up @@ -496,7 +496,7 @@ export default class SlCarousel extends ShoelaceElement {
const nextLeft = nextSlideRect.left - scrollContainerRect.left;
const nextTop = nextSlideRect.top - scrollContainerRect.top;

this.pendingInteraction = true;
this.pendingInteractionScroll = true;
scrollContainer.scrollTo({
left: nextLeft + scrollContainer.scrollLeft,
top: nextTop + scrollContainer.scrollTop,
Expand Down

0 comments on commit cd8495d

Please sign in to comment.