Skip to content
This repository has been archived by the owner on May 26, 2019. It is now read-only.

Add Handling Events page to Components, lists event names #851

Merged
merged 1 commit into from
Oct 3, 2015

Conversation

pixelhandler
Copy link
Contributor

@pixelhandler pixelhandler force-pushed the components-handling-events branch 2 times, most recently from 6216e93 to 0d4b107 Compare October 2, 2015 20:45
@locks locks added this to the 2.1 milestone Oct 2, 2015
});
```

Browser events may bubble up from the target component to each parent component
Copy link
Contributor

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.

Copy link
Contributor Author

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

@pixelhandler
Copy link
Contributor Author

@locks I pushed a commit based responses to your review. I can squash once we're good to merge :)

}
});
```
###Sending Actions
Copy link
Contributor

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)

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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

@pixelhandler pixelhandler changed the title Add Handling Actions page to Components, lists event names Add Handling Events page to Components, lists event names Oct 3, 2015
@pixelhandler
Copy link
Contributor Author

@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.

@locks locks assigned locks and michaelrkn and unassigned locks Oct 3, 2015
@locks
Copy link
Contributor

locks commented Oct 3, 2015

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.
Copy link
Contributor

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… }}
Copy link
Contributor

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?

Copy link
Contributor Author

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

@michaelrkn
Copy link
Contributor

@pixelhandler Thanks so much for putting all this together! I added a few comments with feedback.

@josemarluedke
Copy link
Sponsor Contributor

This is looking good! Thank you for taking care of this.

locks added a commit that referenced this pull request Oct 3, 2015
Add Handling Events page to Components, lists event names
@locks locks merged commit 5c83f74 into emberjs:master Oct 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants