Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

programmatically navigate slides? #188

Open
robsilva opened this issue Jun 17, 2021 · 3 comments
Open

programmatically navigate slides? #188

robsilva opened this issue Jun 17, 2021 · 3 comments

Comments

@robsilva
Copy link

robsilva commented Jun 17, 2021

Is there an API to programmatically allow me to advance or go back slides? How might one go about doing that? The slide arrow button seem to be dynamically added by the plugin, so I can't really put a ref on them, can I?

@itsdwizzy
Copy link

@robsilva You could use the selected prop of <AwesomeSlider> to navigate between slides.

@ghost
Copy link

ghost commented Oct 12, 2021

While this works, I run into the error myself where if changing the selected prop/attribute before the transitioning has completed from the previous change the slider will not update to reflect the new selected slider value. Has anyone figured out a strategy in handling this problem?

@trolit
Copy link

trolit commented Oct 26, 2021

While this works, I run into the error myself where if changing the selected prop/attribute before the transitioning has completed from the previous change the slider will not update to reflect the new selected slider value. Has anyone figured out a strategy in handling this problem?

@JAKERMATE Hi. Did you try to make use of onTransitionStart & onTransitionEnd props? First one is fired when you request slide change and second when transition ends. You could mix that with some boolean value that would disable button unless transition ends? :)

For more details check #185 and https://github.com/rcaferati/react-awesome-slider#main-props.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants