Skip to content

Commit

Permalink
removed transform-input-on-to-onEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
bekzod committed Dec 1, 2017
1 parent 1723b73 commit c83a668
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 211 deletions.
2 changes: 0 additions & 2 deletions packages/ember-template-compiler/lib/plugins/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import TransformOldBindingSyntax from './transform-old-binding-syntax';
import TransformAngleBracketComponents from './transform-angle-bracket-components';
import TransformInputOnToOnEvent from './transform-input-on-to-onEvent';
import TransformTopLevelComponents from './transform-top-level-components';
import TransformInlineLinkTo from './transform-inline-link-to';
import TransformOldClassBindingSyntax from './transform-old-class-binding-syntax';
Expand All @@ -24,7 +23,6 @@ const transforms = [
TransformDotComponentInvocation,
TransformOldBindingSyntax,
TransformAngleBracketComponents,
TransformInputOnToOnEvent,
TransformTopLevelComponents,
TransformInlineLinkTo,
TransformOldClassBindingSyntax,
Expand Down

This file was deleted.

This file was deleted.

43 changes: 2 additions & 41 deletions packages/ember-views/lib/mixins/text_support.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,35 +142,6 @@ export default Mixin.create(TargetActionSupport, {
this.on('input', this, this._elementValueDidChange);
},

/**
The action to be sent when the user presses the return key.
This is similar to the `{{action}}` helper, but is fired when
the user presses the return key when editing a text field, and sends
the value of the field as the context.
@property action
@type String
@default null
@private
*/
action: null,

/**
The event that should send the action.
Options are:
* `enter`: the user pressed enter
* `keyPress`: the user pressed a key
@property onEvent
@type String
@default enter
@private
*/
onEvent: 'enter',

/**
Whether the `keyUp` event that triggers an `action` to be sent continues
propagating to other views.
Expand Down Expand Up @@ -335,21 +306,11 @@ export default Mixin.create(TargetActionSupport, {
// the component semantics so this method normalizes them.
function sendAction(eventName, view, event) {
let action = get(view, `attrs.${eventName}`) || get(view, eventName);
let on = get(view, 'onEvent');
let value = get(view, 'value');

// back-compat support for keyPress as an event name even though
// it's also a method name that consumes the event (and therefore
// incompatible with sendAction semantics).
if (on === eventName || (on === 'keyPress' && eventName === 'key-press')) {
view.sendAction('action', value);
}

view.sendAction(eventName, value);

if (action || on === eventName) {
if (!get(view, 'bubbles')) {
event.stopPropagation();
}
if (action && !get(view, 'bubbles')) {
event.stopPropagation();
}
}

0 comments on commit c83a668

Please sign in to comment.