From 4fbb7ebc549fe083e80d9d7a11d8cf448996e3ba Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Fri, 3 Feb 2017 18:26:52 -0500 Subject: [PATCH] Try using the element's own addEventListener This tries defering to the element's own addEventListener. --- can-define.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/can-define.js b/can-define.js index 5f1226e..a760baa 100644 --- a/can-define.js +++ b/can-define.js @@ -83,7 +83,6 @@ module.exports = define = ns.define = function(objPrototype, defines, baseDefine return data; }); - // Add necessary event methods to this object. for (var prop in eventsProto) { Object.defineProperty(objPrototype, prop, { @@ -177,7 +176,7 @@ define.property = function(objPrototype, prop, definition, dataInitializers, com if ((definition.value !== undefined || definition.Value !== undefined)) { getInitialValue = make.get.defaultValue(prop, definition, typeConvert, eventsSetter); } - + // If property has a getter, create the compute that stores its data. if (definition.get) { computedInitializers[prop] = make.compute(prop, definition.get, getInitialValue); @@ -657,7 +656,10 @@ assign(eventsProto, { } - return eventLifecycle.addAndSetup.apply(this, arguments); + var baseAddEventListener = this.__proto__.addEventListener || + eventLifecycle.addAndSetup; + + return baseAddEventListener.apply(this, arguments); }, // ### unbind