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
For context, my use case for asking the question has the following properties:
I'm using React
2 slidesPerView
currently only 2 slides are in the Swiper instance
I added an onClick handler that attempts to slideTo the clickedIndex
I want to enable clicking on a slide which will set the active slide, thus enabling the active bit on the slide
I'm using the useSwiperSlide hook within slide contexts to check if the slide is active
The slideTo call in my onClick handler is not triggering an update to the activeIndex. I could very well be doing something incorrectly, but wanted to ask the experts.
Note: I have a workaround which involves not using the userSwiperSlide hook and instead tracking (and passing) an activeIndex to slide components.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
For context, my use case for asking the question has the following properties:
onClick
handler that attempts toslideTo
the clickedIndexuseSwiperSlide
hook within slide contexts to check if the slide isactive
The
slideTo
call in myonClick
handler is not triggering an update to theactiveIndex
. I could very well be doing something incorrectly, but wanted to ask the experts.Note: I have a workaround which involves not using the
userSwiperSlide
hook and instead tracking (and passing) an activeIndex to slide components.Beta Was this translation helpful? Give feedback.
All reactions