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

key responder not listening after it was used once #11

Open
SirZach opened this issue Mar 26, 2015 · 1 comment
Open

key responder not listening after it was used once #11

SirZach opened this issue Mar 26, 2015 · 1 comment

Comments

@SirZach
Copy link

SirZach commented Mar 26, 2015

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!

@lukemelia
Copy link
Contributor

Is the modal calling becomeKeyResponder, and if so, with what argument?

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