Skip to content

[BUGFIX canary] Honor customEvents opting out of event listeners.#12059

Merged
rwjblue merged 1 commit intoemberjs:masterfrom
rwjblue:opt-out-events
Aug 13, 2015
Merged

[BUGFIX canary] Honor customEvents opting out of event listeners.#12059
rwjblue merged 1 commit intoemberjs:masterfrom
rwjblue:opt-out-events

Conversation

@rwjblue
Copy link
Member

@rwjblue rwjblue commented Aug 12, 2015

Setting customEvents to a hash in an application is a way to add new listeners that the EventDispatcher knows about.

Often, users see this and decide that they want to disable a given event (for example mouseenter and mouseleave events) and think they can do something like:

var App = Ember.Application.create({
  customEvents: {
    mouseenter: null,
    mouseleave: null
  }
});

Unfortunately, that just makes the EventDispatcher call a method named null on the view/component instances (LOL).

This fixes that bug by allowing a null value to disable the event listener.

Fixes #11540.

Setting `customEvents` to a hash in an application is a way to add new
listeners that the `EventDispatcher` knows about.

Often, users see this and decide that they want to disable a given event
(for example `mouseenter` and `mouseleave` events) and think they can do
something like:

```javascript
var App = Ember.Application.create({
  customEvents: {
    mouseenter: null,
    mouseleave: null
  }
});
```

Unfortunately, that just makes the `EventDispatcher` call a method named
`null` on the view/component instances (LOL).

This fixes that bug by allowing a `null` value to disable the event
listener.
rwjblue added a commit that referenced this pull request Aug 13, 2015
[BUGFIX canary] Honor `customEvents` opting out of event listeners.
@rwjblue rwjblue merged commit ac9405e into emberjs:master Aug 13, 2015
@rwjblue rwjblue deleted the opt-out-events branch August 13, 2015 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Firing run loop on mousemove unnecessary?

1 participant