Skip to content

Commit

Permalink
fix(autoplay): fix a crash with resize when the autoplay has gone awa…
Browse files Browse the repository at this point in the history
…y during timeout (#6431)
  • Loading branch information
aub authored Feb 25, 2023
1 parent a61638a commit adb40f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/events/onResize.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export default function onResize() {
if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
clearTimeout(timeout);
timeout = setTimeout(() => {
swiper.autoplay.resume();
if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
swiper.autoplay.resume();
}
}, 500);
}
// Return locks after resize
Expand Down

0 comments on commit adb40f4

Please sign in to comment.