Emiliano-Bucci/react-spring-carousel-js

`onSlideStartChange` event fires for all rendered carousels

tmcgann opened this issue · 2 comments

Situation: I have two custom carousel components that render on the same page. The components are completely independent and execute useSpringCarousel separately. The second carousel further down the page leverages useListenToCustomEvent to track when the onSlideStartChange event fires so that it can change some state in its component.

Problem: When I use slideToPrevItem or slideToNextItem in the first component, it causes onSlideStartChange to fire in the second component. I assume the event fires for any/all carousels. However, I did NOT expect this. I would expect the events to only fire for the respective components, NOT all components.

@tmcgann Hi, thanks for the feedback! You're right, events should be only triggered for the respective carousel and not for all of them. My bad; when you can, please update to the latest version - 1.9.1 - issue should be fixed now. Let me know :)

@Emiliano-Bucci All fixed up in 1.9.5! Thanks! Keep up the great work!