Skip to content

Commit

Permalink
fix(autoplay): fix autoplay pause during transition
Browse files Browse the repository at this point in the history
fixes #6896
  • Loading branch information
nolimits4web committed Aug 8, 2023
1 parent 88f9630 commit db9b17f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modules/autoplay/autoplay.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export default function Autoplay({ swiper, extendParams, on, emit, params }) {
};
const pause = (internal, reset) => {
if (swiper.destroyed || !swiper.autoplay.running) return;

clearTimeout(timeout);
if (!internal) {
pausedByInteraction = true;
Expand Down Expand Up @@ -210,6 +211,7 @@ export default function Autoplay({ swiper, extendParams, on, emit, params }) {
const onPointerEnter = (e) => {
if (e.pointerType !== 'mouse') return;
pausedByInteraction = true;
if (swiper.animating || swiper.autoplay.paused) return;
pause(true);
};

Expand Down

1 comment on commit db9b17f

@aditya-keri-betterhalf
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @nolimits4web!
Was curious to know how does this commit solve #6896 ?
Because the issue mentions that when a custom speed value has been given, pauseOnMouseEnter doesn't work. And looks like this commit doesn't solve for that.

Please sign in to comment.