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 in directive shortkey unbind hook: "TypeError: i[r] is undefined" #115

Open
pSnehanshu opened this issue May 16, 2020 · 5 comments
Open

Comments

@pSnehanshu
Copy link

I have some shortcuts defined on a vue page. Like this

<div
    v-shortkey="{ undo: ['ctrl', 'z'], redo: ['ctrl', 'y'], redo2: ['ctrl', 'shift', 'z'] }"
    @shortkey="handleKeyboardShortcuts"
  >

Whenever I navigate away from that page, I get the following error message in the console.

In firefox:
[Vue warn]: Error in directive shortkey unbind hook: "TypeError: i[r] is undefined"

In chrome:
[Vue warn]: Error in directive shortkey unbind hook: "TypeError: Cannot read property 'el' of undefined"

Both of them point to this script as the source of the error:
webpack:///node_modules/vue-shortkey/dist/index.js?3717

This hasn't caused any unintended side-effects, but still, I would love to know the cause of this.

@svamja
Copy link

svamja commented Jul 14, 2020

Same here.

[Vue warn]: Error in directive shortkey unbind hook: "TypeError: Cannot read property 'el' of undefined"

This happens, when one navigates using vue router from one component to other component, which does not have the same shortcut keys.

Is there a better approach to avoid getting this error?

And, thank you @iFgR for this wonderful plugin. Keyboard shortcuts are close to a developer's heart!

@fgr-araujo
Copy link
Owner

Thank you @svamja!
I'm so glad to know that you like it!

@pSnehanshu
Copy link
Author

What's the wontfix label?

@fgr-araujo
Copy link
Owner

Fix needed

@rick-lansink
Copy link

Any progress on this issue?

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

No branches or pull requests

4 participants