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

Event handlers attached on Component's init (event) are not called. #1623

Closed
m-mujica opened this Issue Apr 16, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@m-mujica
Contributor

m-mujica commented Apr 16, 2015

The issue is replicated here http://jsbin.com/fucabiyade/1/edit?js,console,output

Basically if you do something like:

can.Component.extend({
  tag: 'app-foo',
  events: {
    init: function(){
      this.on(window, 'click', 'doSomething');
    },
    doSomething: function(){
    }
  }
})

doSomething won't be called if you click around, it does work if the event handler is attached on the inserted event, or if you do (a more idiomatic way I think) {window} click: 'doSomething'. This used to work before CanJS 2.2, probably a regression?

@daffl daffl added the bug label Apr 21, 2015

@daffl daffl modified the milestones: 2.2.5, 2.2.6 Apr 21, 2015

@daffl daffl modified the milestones: 2.2.7, 2.2.6 May 19, 2015

daffl added a commit that referenced this issue Jul 24, 2015

daffl added a commit that referenced this issue Jul 24, 2015

@daffl daffl closed this in #1803 Jul 24, 2015

tracer99 pushed a commit to tucows/canjs that referenced this issue Sep 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment