ember-key-responder
ember-key-responder copied to clipboard
Easy way to use ember-key-responder-base view?
Is there a way to easily apply this boilerplate when you need the key-responder? Do I need to extend my components/views with something or is it a mixin, or? Thank you.
acceptsKeyResponder: true,
didInsertElement: function() {
this.becomeKeyResponder(false /* true: replace | false: pushOnToStack*/);
this._super.apply(this, arguments);
},
willDestroyElement: function() {
this.resignKeyResponder();
this._super.apply(this, arguments);
}
I tend to apply as needed, or create a mixin in my application. I'm not opposed to this addon supplying a mixin if you would like to create a PR adding and documenting it.