diff --git a/packages/blaze/template.js b/packages/blaze/template.js index fddef8f4ed..a12f9e15ca 100644 --- a/packages/blaze/template.js +++ b/packages/blaze/template.js @@ -490,10 +490,10 @@ Template.instance = function () { * * - Inside an `onCreated`, `onRendered`, or `onDestroyed` callback, returns * the data context of the template. + * - Inside an event handler, returns the data context of the template on which + * this event handler was defined. * - Inside a helper, returns the data context of the DOM node where the helper * was used. - * - Inside an event handler, returns the data context of the element that fired - * the event. * * Establishes a reactive dependency on the result. * @locus Client diff --git a/packages/blaze/view.js b/packages/blaze/view.js index b8d429052f..05a1389d63 100644 --- a/packages/blaze/view.js +++ b/packages/blaze/view.js @@ -817,10 +817,9 @@ Blaze._addEventMap = function (view, eventMap, thisInHandler) { return null; var handlerThis = thisInHandler || this; var handlerArgs = arguments; - return Blaze._withCurrentView(Blaze.getView(evt.currentTarget), - function () { - return handler.apply(handlerThis, handlerArgs); - }); + return Blaze._withCurrentView(view, function () { + return handler.apply(handlerThis, handlerArgs); + }); }, range, function (r) { return r.parentRange; diff --git a/packages/spacebars-tests/template_tests.html b/packages/spacebars-tests/template_tests.html index fd1d469eb4..6ff3a5582a 100644 --- a/packages/spacebars-tests/template_tests.html +++ b/packages/spacebars-tests/template_tests.html @@ -1028,14 +1028,6 @@ Hi there! {{> Template.contentBlock}} - -