Mixing in can/event conflicts with can.Control-based classes #981

Closed
andykant opened this Issue May 9, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@andykant
Contributor

andykant commented May 9, 2014

When using the new can/event mixin, it can cause conflicts with can.Control-based classes due to duplicate methods can.Control#on and can.Control#off.

This will generally cause an exception on load:

var MyControl = can.Control.extend(can.extend({}, can.event, {
  " click": function() { /* doesn't fire */ }
}));

This is an existing workaround:

var MyControl = can.Control.extend({
  " click": function() { /* does fire */ }
});
MyControl.prototype = can.extend({}, can.event, MyControl.prototype);
@ccummings

This comment has been minimized.

Show comment
Hide comment
@ccummings

ccummings May 16, 2014

Contributor

Fixed in master

Contributor

ccummings commented May 16, 2014

Fixed in master

@ccummings ccummings closed this May 16, 2014

gsmeets pushed a commit to gsmeets/canjs that referenced this issue Aug 15, 2014

@andykant andykant removed their assignment Oct 29, 2015

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