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

Is it possible to disable keyboard navigation on advanceOn steps? #491

Closed
iamsachin opened this issue Aug 8, 2019 · 9 comments · Fixed by #508
Closed

Is it possible to disable keyboard navigation on advanceOn steps? #491

iamsachin opened this issue Aug 8, 2019 · 9 comments · Fixed by #508
Labels

Comments

@iamsachin
Copy link

iamsachin commented Aug 8, 2019

I am using the advanceOn to go to the next step. I didn't provide the next button, which is good. But the user is still able to go to next step using the keyboard.

@RobbieTheWagner
Copy link
Member

@iamsachin I am not sure the best way to handle this. We want to enable it as much as we can for a11y. I suppose we could have a keyboardNavigation option, that could be set to false, but it might be nice to have something more robust, where keyboard nav and the next/previous buttons could be disabled until certain conditions are met.

@iamsachin
Copy link
Author

iamsachin commented Aug 8, 2019

Do you plan of having such a feature in the future?

where keyboard nav and the next/previous buttons could be disabled until certain conditions are met.

This would be really great actually.
I am currently using the app on Vue based front end, and my advanceOn action is re-rendering many things in the page. Sometimes, the selectors are changing and the tour step is not rendering properly because it cannot find the item.

@iamsachin
Copy link
Author

Do the steps look for anchor point using the document.querySelector at the time of showing step, or while use .addStep or .addSteps?

@RobbieTheWagner
Copy link
Member

@iamsachin I really try to discourage the use of advanceOn I would like to remove that option in the future entirely. It's much more stable to call tour.next() when you want to advance. Would that work for you or do you need advanceOn?

@RobbieTheWagner
Copy link
Member

Do the steps look for anchor point using the document.querySelector at the time of showing step, or while use .addStep or .addSteps?

It should be during the show call, not during addStep.

I am currently using the app on Vue based front end, and my advanceOn action is re-rendering many things in the page

I am very curious on this behavior. Do you have an example?

@iamsachin
Copy link
Author

tour.next() does feel like a cleaner solution and better than advanceOn.

It should be during the show call, not during addStep.

This information will save me a lot of time. 👍

I am very curious on this behavior. Do you have an example?

I cannot show a screenshot here because of sensitive data. I'll try to create an example screen and show you.

@RobbieTheWagner
Copy link
Member

I don't need a screenshot, but some example code showcasing the problem would be great 👍

@iamsachin
Copy link
Author

iamsachin commented Aug 8, 2019

        this.beforeShowPromise = () => {
          return new Promise(function(resolve) {
            setTimeout(() => {
              resolve();
            }, 1000);
          });
        };

For example, within this timeout, the element is being rendered in the DOM.
Yet, I am not able to attachTo that newly rendered element. The step is showing after a second

However, if I am using the parent div in attachTo, it is selecting including the newly rendered child.

@RobbieTheWagner
Copy link
Member

@iamsachin _show is not called until after the promise from beforeShowPromise resolves. What are you passing to attachTo? It should work. I think I really need a full example please. Can you make a CodePen or something?

RobbieTheWagner added a commit that referenced this issue Aug 13, 2019
This allows for configurability to disabled keyboard navigation and/or exiting the tour on ESC.

Closes #491
RobbieTheWagner added a commit that referenced this issue Aug 13, 2019
This allows for configurability to disabled keyboard navigation and/or exiting the tour on ESC.

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

Successfully merging a pull request may close this issue.

2 participants