Open sebastianhelbig opened 5 years ago
I have the same problem. All elements are duplicated, but actions on elements are not. Because of that, some buttons work in the initial slide, but not in the duplicated slide.
We can look into the duplicate ID issue, however for the actions is there anything preventing you from using event delegation?
I solved the duplicate id issue by extending swiper-slide
component and setting tagName: ''
.
@sebastianhelbig glad you got it working for you, however this fix doesn't make much sense to me at the moment. Doesn't that remove the slide element (one with the swiper-slide
class) from the DOM?
@Matt-Jensen
app/components/swiper-slider.js
import SwiperSlide from 'ember-cli-swiper/components/swiper-slide';
export default SwiperSlide.extend({
tagName: ''
});
app/templates/components/swiper-slide.hbs
<div class="swiper-slide">
{{yield}}
</div>
Thanks @sebastianhelbig.
When using the swiper option
loop: true
, the swiper will duplicate the slides. This leads to having element with duplicate ids in the DOM