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

Jump Tour Steps #58

Closed
tragicmj opened this issue Jul 19, 2022 · 2 comments · Fixed by #91
Closed

Jump Tour Steps #58

tragicmj opened this issue Jul 19, 2022 · 2 comments · Fixed by #91
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed released

Comments

@tragicmj
Copy link

Suppose if I wish to jump tour steps on condition. For example if a condition is satisfied it moves from index 0 to 3 else it moves from index 0 to 1. Is this possible?

@JoseLion
Copy link
Member

@tragicmj yes, in the context returned by useSpotlightTour you have the method goTo(index), which should allow you to jump to any step. You can also use the current property in case you need to know the current step:

const { current, goTo, next } = useSpotlightTour();

const conditionalNext = (): void => {
  current === 0
    ? goTo(condition ? 3 : 1)
    : next()
};

However, I noticed the goTo(index) function is missing in the renders props of the TourStep component. I think that's something we can improve 🙂

@JoseLion JoseLion added enhancement New feature or request help wanted Extra attention is needed waiting-for-feedback labels Aug 12, 2022
@JoseLion JoseLion added bug Something isn't working and removed enhancement New feature or request waiting-for-feedback labels Feb 14, 2023
@github-actions
Copy link

🎉 This issue has been resolved in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants