Skip to content

Commit

Permalink
fix(core): don't call realIndexChange on initialIndex if runCallbac…
Browse files Browse the repository at this point in the history
…ksOnInit is disalbed

fixes #6976
  • Loading branch information
nolimits4web committed Aug 30, 2023
1 parent 1b74619 commit 48c4e0a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/update/updateActiveIndex.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,11 @@ export default function updateActiveIndex(newActiveIndex) {
}
swiper.emit('activeIndexChange');
swiper.emit('snapIndexChange');
if (previousRealIndex !== realIndex) {
swiper.emit('realIndexChange');
}

if (swiper.initialized || swiper.params.runCallbacksOnInit) {
if (previousRealIndex !== realIndex) {
swiper.emit('realIndexChange');
}
swiper.emit('slideChange');
}
}

0 comments on commit 48c4e0a

Please sign in to comment.