You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using infinite mode, some slides are cloned.
These cloned slides don't have instances of directives/components attached to appropriate elements.
That's probably because slick itself handles cloning of slides, and it clones only DOM nodes, not angular instances.
This causes problems with any dynamic changes to slides.
afterChange(changeEvent: any) {
const elements = changeEvent.event.target.lastElementChild.firstChild.getElementsByClassName('slick-cloned') as HTMLElement[];
for (const element of elements) {
if(!element.classList.contains('listen')){
element.classList.add('listen')
element.addEventListener('click', (clickEvent: any) => {
// Navigation logic here
});
}
}
}
related to #31 #18
When using infinite mode, some slides are cloned.
These cloned slides don't have instances of directives/components attached to appropriate elements.
That's probably because slick itself handles cloning of slides, and it clones only DOM nodes, not angular instances.
This causes problems with any dynamic changes to slides.
See stackblitz:
https://stackblitz.com/edit/angular-chf3v8
Original carousel items are changed by code inside CarouselItemComponent, cloned slides are not.
The text was updated successfully, but these errors were encountered: