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

Record plugin: "Uncaught ReferenceError: i is not defined" #473

Open
DmitryShashkov opened this issue Feb 15, 2020 · 1 comment
Open

Record plugin: "Uncaught ReferenceError: i is not defined" #473

DmitryShashkov opened this issue Feb 15, 2020 · 1 comment

Comments

@DmitryShashkov
Copy link

I am trying to use the 'mousetrap-record' plugin. I've added all required scripts to my page, and then used the code from documentation:

Mousetrap.record(function(sequence) {
  // sequence is an array like ['ctrl+k', 'c']
  alert('You pressed: ' + sequence.join(' '));
});

In runtime, when I trigger the recording and hit any button, it throws this error:
Error log

As I can see, the origin of an error is this method:
Method with error
Obviously, on line 73 i variable is used, but it wasn't defined before.

Simple defining this variable solves the problem - like this:
Solution

May I create a pull request for this?

@DmitryShashkov
Copy link
Author

For everyone interested: I've fixed this issue, as well as #324 in my fork of this lib -
https://github.com/DmitryShashkov/mousetrap
I have also published it as an NPM module: https://www.npmjs.com/package/tn-mousetrap

I believe this is temporary, cause I hope solutions for both issues will be merged into original repository. But meanwhile, it may come in handy for someone.

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

1 participant