ember-key-responder icon indicating copy to clipboard operation
ember-key-responder copied to clipboard

Easy way to use ember-key-responder-base view?

Open oskarrough opened this issue 9 years ago • 1 comments

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);
}

oskarrough avatar May 16 '15 14:05 oskarrough

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.

lukemelia avatar Sep 07 '15 03:09 lukemelia