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

becomeKeyResponder replaces by default

Open stefanpenner opened this issue 10 years ago • 5 comments

The following is required to get the stack behavior.

this.becomeKeyResponder(false);

I would like to propose the stack behavior should be the default.

Maybe different API for each case?

this.becomeKeyResponder(); // pushes onto the stack
this.replaceKeyResponder();  // replaces the stop of the stack

relevant code: https://github.com/yapplabs/ember-key-responder/blob/master/app/key-responder.js#L127-L131

pros:

  • clear

cons:

  • breaking change
  • more API

stefanpenner avatar Jan 02 '15 18:01 stefanpenner

Making push behavior the default doesn't seem to line up with what we do most often. I like the different API for each case idea.

raycohen avatar Jan 02 '15 19:01 raycohen

@raycohen maybe we leave becomeKeyResponder + deprecate, but then add pushKeyResponder and replaceKeyResponder for added clarity moving forward?

stefanpenner avatar Jan 02 '15 22:01 stefanpenner

thumbs up

On Fri, Jan 2, 2015 at 5:28 PM, Stefan Penner [email protected] wrote:

@raycohen https://github.com/raycohen maybe we leave becomeKeyResponder

  • deprecate, but then add pushKeyResponder and replaceKeyResponder for added clarity moving forward?

— Reply to this email directly or view it on GitHub https://github.com/yapplabs/ember-key-responder/issues/6#issuecomment-68568668 .

raycohen avatar Jan 02 '15 22:01 raycohen

I like it.

On Fri, Jan 2, 2015 at 2:36 PM, Ray Cohen [email protected] wrote:

thumbs up

On Fri, Jan 2, 2015 at 5:28 PM, Stefan Penner [email protected] wrote:

@raycohen https://github.com/raycohen maybe we leave becomeKeyResponder

  • deprecate, but then add pushKeyResponder and replaceKeyResponder for added clarity moving forward?

— Reply to this email directly or view it on GitHub < https://github.com/yapplabs/ember-key-responder/issues/6#issuecomment-68568668>

.

— Reply to this email directly or view it on GitHub https://github.com/yapplabs/ember-key-responder/issues/6#issuecomment-68569271 .

lukemelia avatar Jan 02 '15 22:01 lukemelia

Multiple methods always beats one method with flags to change behavior 😀

jamesarosen avatar Jun 30 '15 23:06 jamesarosen