Prevent user from advancing slide until condition is met
See original GitHub issueNot a bug, just a question on functionality.
I want to use the behaviour you get when swiping the last slide in the slideshow, but not just at the end, but on each slide unless a certain condition is met.
E.g. You have a slide with a form field, when the field is not valid and you try and swipe, you can see some of the next slide but it won’t let you advance and bounces back, like the last slide of a normal slider. When the form field is valid, you can swipe the slide as normal.
Anyone found a solution to be able to do this?
onSwipe
fires before beforeChange
so I can’t get the current slide index - which I could use to check if that slide is valid. I could use afterChange
to move the slider back one slide, but that would be allowing the user to advance to the next slide, which I don’t want.
Any advice appreciated!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:5
@Dobby89 We did but it’s so long ago I can’t remember and don’t have access to the code, sorry 😦
I’d also like this functionality. I tried using
beforeChange
to prevent the slide from advancing, but it didn’t work.@paulcredmond Did you manage to come up with a solution (short of dynamically adding/removing slides)?