diff --git a/src/core/modules/observer/observer.mjs b/src/core/modules/observer/observer.mjs index c8acf3271..d50c61ed9 100644 --- a/src/core/modules/observer/observer.mjs +++ b/src/core/modules/observer/observer.mjs @@ -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, }); diff --git a/src/swiper-element.mjs b/src/swiper-element.mjs index c207c7c34..5624df620 100644 --- a/src/swiper-element.mjs +++ b/src/swiper-element.mjs @@ -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) => {