Skip to content

Commit

Permalink
Fix the error indicated by automated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
imajus committed Mar 3, 2023
1 parent 9af4a62 commit 9e57d5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/blaze/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,13 @@ Template.prototype.events = function (eventMap) {
eventMap2[k] = (function (k, v) {
return function (event /*, ...*/) {
var view = this; // passed by EventAugmenter
var args = Array.prototype.slice.call(arguments);
// Exiting the current computation to avoid creating unnecessary
// and unexpected reactive dependencies with Templates data
// or any other reactive dependencies defined in event handlers
return Tracker.nonreactive(function () {
var data = Blaze.getData(event.currentTarget);
if (data == null) data = {};
var args = Array.prototype.slice.call(arguments);
var tmplInstanceFunc = Blaze._bind(view.templateInstance, view);
args.splice(1, 0, tmplInstanceFunc());
return Template._withTemplateInstanceFunc(tmplInstanceFunc, function () {
Expand Down

0 comments on commit 9e57d5a

Please sign in to comment.