Skip to content
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

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

Merged
merged 1 commit into from
Aug 13, 2015

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