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

Feature Request: Support for changing component via the router #47

Open
chrisd-cotswold opened this issue May 1, 2020 · 9 comments
Open

Comments

@chrisd-cotswold
Copy link

First, this package is great and I have been able to do some cool stuff with it, but now I wanted to go a bit further and I've hit a wall.

In the action function I want to be able to call router.navigate and essentially move between pages in our app. The problem is that there is no ability to pause while the router does its stuff.

I added a 500ms entry to the timeout in the nextStep function and that allowed the router to complete before the checkSelectorValidity fired, without that delay the DOM has not been refreshed and the step is skipped.

What I am hoping for is either a more well thought out solution than mine monitoring the router for changes OR just an option to specify a timeout value in the step, which whilst crude, would work.

Can this be added ?

@RobertCMusk
Copy link
Contributor

Thank you for the feedback!

Ideally we eventually add functionality for this or someone has a PR to add it, but we have not had a good internal use case for me to add it.

But I think you may be able to do this with a combination of work arounds and it will be a little more foolproof that a timeout. I haven't tested it yet, so tell me if it works. I think you set up two tours. Tour one ends with navigating to the second page with a query param. You then start tour two based on the query param. This will allow the second tour to set its' own start conditions so you can wait on content to load and service responses to come back.

There are some downsides to this of course. Step numbers are not valid, and the tour may not feel as seamless.

I am unsure of a timeline of us creating a PR to add more official functionality, so if you or anyone else adds it we will expedite reviewing it and getting it merged in. But I will try to see if we can do something sooner rather than later.

@dariel312
Copy link

👍 Love the plugin but the ability to be able to change pages smoothly would be nice

@Judp0m
Copy link

Judp0m commented Sep 19, 2020

+1 for the routing feature request, or even better:
action and closeAction should support async function and wait for their completion.
This would open up a lot of options to make more advanced tours.

@NadavRosenberg
Copy link

@Judp0m +1

@mivanyna
Copy link

mivanyna commented Aug 3, 2022

+1 for the routing feature request, or even better: action and closeAction should support async function and wait for their completion. This would open up a lot of options to make more advanced tours.

This would definitely make a big step in usability with small changes made

And maybe expose a property for delay for setTimeout in nextStep call

@mivanyna
Copy link

mivanyna commented Aug 5, 2022

Here is the PR with changes #121

@thomasbottonari
Copy link
Contributor

thanks @mivanyna we'll take a look!

@rafagsiqueira
Copy link

Instead of adding the delay, making action and closeAction accept asynchronous functions would indeed open up a lot of option for more advanced tours. Exactly like @Judp0m suggested.

@eltongonc
Copy link

I ran into a use case where this would be very nice to have! Is there any progress on this?

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

9 participants