Closed hodovani closed 6 years ago
Closing as stale. If still facing any problem related to this. Please reopen with more details or perhaps a codesandbox demo.
@laveesingh Can we reopen this? I'd like the same functionality.
Discussion on the same topic on the main JS version here: https://github.com/kenwheeler/slick/pull/2104
I had this issue when trying to prevent keyboard left/right clicks from moving the slides. What I used was an onClick event and blur() in order to prevent.
handleClick(e) {
var target = e.target.closest('.slick-slide') || e.target
target.blur()
}
hope this helps!
@pbortnick I did something similar, but the ideal solution I think is to show an animation and have it 'bounce' back so the user is aware the action (prev/next) works but is not allowed to go to the next slide. In my situation it's a slider of form fields so you need to complete the current field before being allowed to move on to the next one.
@paulcredmond do you have realization of your idea?
how to prevent the Splatter effect in react-slick
Is there any way to prevent change slide?
I tried to catch beforeChange event and change state of slider to current slide but it doesn't help.
Also I tried to set initialSlide to catch if i lost mu curent index on rerender, but it doesn't help.
I had
initialSlide: this.refs.slider ? this.refs.slider.innerSlider.state.currentSlide : 1,
and on rerender it doesn't set to 1. It just go to 0 and I can do nothing with that/