Skip to content

Commit 7cffede

Browse files
committed
fix(element): fix observer to watch for slides
fixes #7598
1 parent 4adb85b commit 7cffede

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/core/modules/observer/observer.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ export default function Observer({ swiper, extendParams, on, emit }) {
2626
window.setTimeout(observerUpdate, 0);
2727
}
2828
});
29-
3029
observer.observe(target, {
3130
attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
32-
childList: typeof options.childList === 'undefined' ? true : options.childList,
31+
childList:
32+
swiper.isElement || (typeof options.childList === 'undefined' ? true : options).childList,
3333
characterData: typeof options.characterData === 'undefined' ? true : options.characterData,
3434
});
3535

src/swiper-element.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ class SwiperContainer extends ClassToExtend {
158158

159159
// eslint-disable-next-line
160160
this.swiper = new Swiper(this.shadowRoot.querySelector('.swiper'), {
161-
...(swiperParams.virtual
162-
? {}
163-
: { observer: true, observeSlideChildren: this.slideSlots > 0 }),
161+
...(swiperParams.virtual ? {} : { observer: true }),
164162
...swiperParams,
165163
touchEventsTarget: 'container',
166164
onAny: (name, ...args) => {

0 commit comments

Comments
 (0)