From ab7dd4229a0a64a563a43021fd4d3d03b8ddd34f Mon Sep 17 00:00:00 2001 From: James Henry Date: Fri, 9 Nov 2018 15:28:44 -0500 Subject: [PATCH] fix(directive): normalize names in prop and event bindings It seems when jQuery is used, it will usually wrap the original CustomEvent which breaks the interface of the expected detail payload --- src/directive.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/directive.ts b/src/directive.ts index 4a2ef81..29948e3 100644 --- a/src/directive.ts +++ b/src/directive.ts @@ -76,7 +76,8 @@ export const directiveFactory = [ // Set up event bindings. eventExprPairs.forEach(([eventName, parsedExpr]) => { elem.on(eventName, evt => { - var callback = parsedExpr.bind(null, scope, { $event: evt }); + evt = evt.originalEvent || evt; + const callback = parsedExpr.bind(null, scope, { $event: evt }); if (!$rootScope.$$phase) { scope.$apply(callback);