Skip to content

Commit

Permalink
fix(autoplay): keep 0 transition on touchmove with 0 timeout delay
Browse files Browse the repository at this point in the history
fixes #7515
  • Loading branch information
nolimits4web committed May 13, 2024
1 parent 2c08227 commit 8ccb08e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/core/events/onTouchMove.mjs
Expand Up @@ -174,6 +174,9 @@ export default function onTouchMove(event) {
const evt = new window.CustomEvent('transitionend', {
bubbles: true,
cancelable: true,
detail: {
bySwiperTouchMove: true,
},
});
swiper.wrapperEl.dispatchEvent(evt);
}
Expand Down
3 changes: 2 additions & 1 deletion src/modules/autoplay/autoplay.mjs
Expand Up @@ -37,8 +37,9 @@ export default function Autoplay({ swiper, extendParams, on, emit, params }) {
function onTransitionEnd(e) {
if (!swiper || swiper.destroyed || !swiper.wrapperEl) return;
if (e.target !== swiper.wrapperEl) return;

swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd);
if (pausedByPointerEnter) {
if (pausedByPointerEnter || (e.detail && e.detail.bySwiperTouchMove)) {
return;
}
resume();
Expand Down

0 comments on commit 8ccb08e

Please sign in to comment.