Swiper: Events in repeated slides are not working

Created on 14 Aug 2019  路  1Comment  路  Source: nolimits4web/swiper

This is a (multiple allowed):

  • [x] bug
  • [ ] enhancement
  • [ ] feature-discussion (RFC)
  • Swiper Version: 4.5.0
  • Platform/Target and Browser Versions: Firefox and Chrome on Windows 10

What you did

  1. I initiated with the following settings
  2. I loaded the slider
  3. I clicked on a button in the slide with a attached event handler and it is working
  4. I clicked on the previous button
  5. I clicked on the same button in an other slide and it is not working.
let slider = new window.swiper(element, {
init: false,
direction: 'horizontal',
loop: true,
slidesPerView: 4,
slidesPerGroup: 4,
spaceBetween: 8,
preloadImages: false,
lazy: true,
observer: true,
observeParents: true,
navigation: {
    nextEl: '#' + this.sliderId + ' .swiper-button-next',
    prevEl: '#' + this.sliderId + ' .swiper-button-prev',
},
breakpoints: {
    1100: {
        slidesPerView: 3,
        slidesPerGroup: 3
    },
    850: {
        slidesPerView: 2,
        slidesPerGroup: 2
    },
    550: {
        slidesPerView: 1,
        slidesPerGroup: 1
    }
},
});

slider.on('init', () => { this.loaded = true; });
slider.init();

It's the same problem as described here:

Expected Behavior

Event handlers in repeated slides should work

Actual Behavior

The event is not firing. It is just triggering for not repeated slides. Same thing is happening if I click on the next button after the last slide.

>All comments

Add events considering there are repeated slides, e.g. using live events

Was this page helpful?
0 / 5 - 0 ratings

Related issues

QJan84 picture QJan84  路  3Comments

cristianfierro picture cristianfierro  路  4Comments

lxmarinkovic picture lxmarinkovic  路  4Comments

chansecampbell picture chansecampbell  路  3Comments

TomDeSmet picture TomDeSmet  路  3Comments