-
-
Notifications
You must be signed in to change notification settings - Fork 873
Add Handling Events page to Components, lists event names #851
Conversation
6216e93
to
0d4b107
Compare
}); | ||
``` | ||
|
||
Browser events may bubble up from the target component to each parent component |
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.
this one is tricky, because they bubble up the DOM, not up component hierarchy. this matters for example for block components.
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.
true, and that dom includes the parent components so need to update this verbage
@locks I pushed a commit based responses to your review. I can squash once we're good to merge :) |
} | ||
}); | ||
``` | ||
###Sending Actions |
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.
h2, not h3 (confirm @michaelrkn)
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.
I just remembered, we're moving towards closure actions so I'd not sure how that would affect 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.
I don't think closure actions should not be covered here
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.
I'm so confused by the double negative xD
@locks I changed up the context of the event narrative, I hope it does a better job of illustrating how/why to use event handlers in a component. |
lmgt |
@@ -0,0 +1,129 @@ | |||
Instead of having to register event listeners on elements you'd like to | |||
respond to, simply implement the name of the event you want to respond to | |||
as a method on your component. |
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.
I'd suggest a more positive introduction, like "You can respond to user events on your component like double-clicking, hovering, and key presses through event handlers." Starting out by contrasting Ember to another approach feels negative and assumes the reader comes from a particular background.
I think it would better to introduce event handling as a solution to a problem, rather than as an alternative to
|
||
```hbs | ||
{{x-draggable action="didDrop"}} | ||
{{! …an element as a drop affordance may go in here… }} |
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.
What's an "affordance"? Is there a way to rephrase this using more common vocabulary?
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.
a ui term for an element that you can interact with, I'll remove it, it distracts from the topic
@pixelhandler Thanks so much for putting all this together! I added a few comments with feedback. |
1058851
to
2a24732
Compare
2a24732
to
aeee53f
Compare
This is looking good! Thank you for taking care of this. |
Add Handling Events page to Components, lists event names
rendered page
[Fixes #621]