# Deep Dive on Ember Events

DevFeed: [Deep Dive on Ember Events](<https://devfeed.tech/articles/deep-dive-on-ember-events-15597.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/deep-dive-on-ember-events>)

Author: Marie Chatfield

Published: 2017-08-08T20:41:09Z

Content type: article

Language: en

Sources: [Square Corner](<https://devfeed.tech/sources/square-corner-blog-medium.md>)

Topics: [Ember](<https://devfeed.tech/topics/ember.md>), [Front end](<https://devfeed.tech/topics/frontend.md>), [UI components](<https://devfeed.tech/topics/ui-components.md>), [Handlebars](<https://devfeed.tech/topics/handlebars.md>)

Tags: [abstraction](<https://devfeed.tech/tags/abstraction.md>), [actions](<https://devfeed.tech/tags/actions.md>), [apis](<https://devfeed.tech/tags/apis.md>), [dom-events](<https://devfeed.tech/tags/dom-events.md>), [ember](<https://devfeed.tech/tags/ember.md>), [event-listeners](<https://devfeed.tech/tags/event-listeners.md>), [events](<https://devfeed.tech/tags/events.md>)

## AI overview

Ember DOM event listeners run before Ember action listeners, which explains why changing `{{action "toggleTheThing"}}` to `onClick={{action "toggleTheThing"}}` made the parent toggle before the child action could stop Ember action bubbling, closing the thing immediately. Component event attributes such as `click=(action ...)` and the `{{action}}` helper use Ember actions; HTML event attributes such as `onclick` use browser DOM events. Component event attributes and HTML event attributes receive the original DOM event, while the action helper does not. `bubbles=false` works with the action helper but not closure actions; `event.stopPropagation()` requires access to the original event. Stopping propagation in a DOM handler can also prevent Ember actions from firing. The author recommends Ember actions for consistency, with conditional DOM listeners described as one possible exception.

## Source excerpt

The difference between Ember actions and DOM events and why it matters, plus a really rad flowchart.