ember-key-responder
ember-key-responder copied to clipboard
key responder not listening after it was used once
I've set up my views/application.js
to the following:
import Ember from 'ember';
export default Ember.View.extend({
acceptsKeyResponder: true,
didInsertElement: function () {
this.becomeKeyResponder(false);
this._super.apply(this, arguments);
}),
willDestroyElement: function () {
this.resignKeyResponder();
this._super.apply(this, arguments);
}),
shiftSpace: function () {
//opens modal, I've tweaked the MODIFIED_KEY_EVENTS hash to listen to key code 32
}
});
Once I open the modal and close it, the view no longer gets the shiftSpace
action anymore despite my clicking everywhere to make sure it's in focus. Any suggestions on how to add key listeners to the ember app as a whole? I'm trying to implement Mac OSX Spotlight Search functionality within the app so I want it available no matter where you are in the app. Thanks!
Is the modal calling becomeKeyResponder
, and if so, with what argument?