Skip to content

Commit

Permalink
fix(element): fix observer to watch for slides
Browse files Browse the repository at this point in the history
fixes #7598
  • Loading branch information
nolimits4web committed Jul 15, 2024
1 parent 4adb85b commit 7cffede
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/core/modules/observer/observer.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export default function Observer({ swiper, extendParams, on, emit }) {
window.setTimeout(observerUpdate, 0);
}
});

observer.observe(target, {
attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
childList: typeof options.childList === 'undefined' ? true : options.childList,
childList:
swiper.isElement || (typeof options.childList === 'undefined' ? true : options).childList,
characterData: typeof options.characterData === 'undefined' ? true : options.characterData,
});

Expand Down
4 changes: 1 addition & 3 deletions src/swiper-element.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ class SwiperContainer extends ClassToExtend {

// eslint-disable-next-line
this.swiper = new Swiper(this.shadowRoot.querySelector('.swiper'), {
...(swiperParams.virtual
? {}
: { observer: true, observeSlideChildren: this.slideSlots > 0 }),
...(swiperParams.virtual ? {} : { observer: true }),
...swiperParams,
touchEventsTarget: 'container',
onAny: (name, ...args) => {
Expand Down

0 comments on commit 7cffede

Please sign in to comment.