-
Notifications
You must be signed in to change notification settings - Fork 254
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
multiplied bindings #35
Comments
They shouldn't be -- there are test cases to prevent that. Are you defining the hotkeys through the routing? You may just be setting up persistent hotkeys. |
Hi, thanks for response. Hotkeys are defined only in one controller, because only in that controller are needed. But I used |
No -- controller-based hotkeys are persistent by default, as they are used for things like a navigation bar which is present on every page. It's related to #32 but can be fixed by manually specifying that the hotkey is not intended to be persistent. This is the method signature: /**
* Creates a new Hotkey and creates the Mousetrap binding
*
* @param {string} combo mousetrap key binding
* @param {string} description description for the help menu
* @param {Function} callback method to call when key is pressed
* @param {string} action the type of event to listen for (for mousetrap)
* @param {array} allowIn an array of tag names to allow this combo in ('INPUT', 'SELECT', and/or 'TEXTAREA')
* @param {boolean} persistent if true, the binding is preserved upon route changes
*/
function _add (combo, description, callback, action, allowIn, persistent) { So simply pass in hotkeys.add({
combo: 'w',
description: '....',
callback: function() {},
persistent: false
}); |
I don't know how it happened, but it was browser-related issue ... in newer version it works fine. Thanks for help. |
Hi, we'reusing
angular-hotkyes
in our project.On site
index
we have welcome page, on another sitehome
there are some actions with added hotkeys.When I navigate from
index
tohome
and show help through?
everything is fine. Then I navigate toindex
and back tohome
and keys are doubled (then tripled, ... etc.)The text was updated successfully, but these errors were encountered: