Skip to content

not working? fn.selector undefined #4

@ericgj

Description

@ericgj

I thought I was doing something wrong in my code, but I tried the example.html and it's not firing events either.

The problem seems to be the fn.selector is undefined when delegate.bind is called (L#34). Meaning that the _onbind hook isn't run yet.

I don't quite follow the sequence of events but it seems like the basic issue is that in EventManager, addBinding fires the onbind before the this._onbind hook, and in DelegateManager, the onbind assumes this._onbind has already been run.

EventManager.prototype.bind = function(event, method){
  var fn = this.addBinding.apply(this, arguments);   // this._bind() called here
  if (this._onbind) this._onbind(event, method, fn);
  this._bind(event, fn);
  return fn;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions