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

Error when using keyboard to navigate through the steps. (Uncaught TypeError: Cannot read property 'element' of undefined. ) #33

Closed
MSPShaun opened this issue Dec 18, 2019 · 1 comment

Comments

@MSPShaun
Copy link

I have found that an error gets called anytime i navigate through the steps of a tutorial using a keyboard. The error can be triggered by

  1. Starting a tutorial
  2. Using the right arrow key to go through all the steps
  3. On the last step, try to use the right arrow key again. This will cause the error.
    Uncaught TypeError: Cannot read property 'element' of undefined at IntroJs._nextStep (intro.js?479f:425) at IntroJs._onKeyDown (intro.js?479f:320) at handler (intro.js?479f:1576)

It seems as though there is a counter that is still getting triggered by the keyboard event even though there isn't any steps remaining. this error doesn't exist when using the main Intro.js library (Non-react), instead it would close the tutorial.

This error can easily be reproduced using the sandbox demo given in this repository:
https://codesandbox.io/embed/o2A4gwXE3?hidenavigation=1

@HiDeoo
Copy link
Owner

HiDeoo commented May 21, 2020

This is actually an issue in Intro.js itself (cf. usablica/intro.js#951 for a similar issue)

The report summarize the issue but it boils down to these lines when using the introJs.onbeforechange() API (which is always the case of this library) and Intro.js not checking step bounds before trying to call this callback.

Considering the number of pending PRs for Intro.js (if still maintained), you may need to fork the library yourself or patch it somehow.

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

2 participants