-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Adding on-click
and on-blur
actions
#92
Conversation
@@ -77,7 +77,24 @@ export default Ember.Component.extend({ | |||
this._updateValueSingle(); | |||
} | |||
|
|||
this.sendAction('action', this.get('value'), this); | |||
this.sendAction('action', this.get('value'), this); // should we deprecate `action` in favor of `on-change`? | |||
this.sendAction('on-change', this.get('value'), this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're adding other event actions I feel like we should deprecate the action
action in favor of a more descriptive name like on-change
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
action
is still the name of the attribute that holds the default action in the native ember input
component, and so I think we should hold close to that.
* component's action with the jQuery event, x-select value, and the component. | ||
*/ | ||
click(event) { | ||
this.sendAction('on-click', event, this.get('value'), this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the value of the componnent be the first argument? I believe this is the behavior in the components that ship with ember. We should verify what happens when you do both:
{{input on-click=(action "doStuff")}}
and
<div on-click=(action "do stuff")>Hmmm....</div>
If we're going to do |
The skipped test is an odd one. In real life I can click the select, remove focus, and the focus out action fires. In tests the action doesn't get fired. I can tell the `focusOut` event gets called on the component in tests. But the `sendAction('on-focus-out')` doesn't seem to fire. Remember this all works in real life. Just tests it's odd.
I think also, that we need to get some clarity once and for all about what the Ember conventions are for event attributes because I'm confused. According to the guides, it appears that the attributes would be We need to ascertain
and then make x-select copy those conventions as closely as possible. |
@cowboyd it looks like it's hyphenated, sends the component, and sends the event: |
@Robdel12 In that example, it uses |
@cowboyd it looks like you can't send an action called |
Adding `onclick` and `onblur`, `onfocusout` actions
This is the first pass to get the ball rolling.