From e350782fce61eeb379b66bbabb717cfb9a4d99c2 Mon Sep 17 00:00:00 2001 From: David Greenspan Date: Wed, 9 Oct 2013 17:20:18 -0700 Subject: [PATCH] wrap event handling in Deps.nonreactive --- packages/ui/base.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ui/base.js b/packages/ui/base.js index 8bb5e1b845..7fa27861f7 100644 --- a/packages/ui/base.js +++ b/packages/ui/base.js @@ -1217,7 +1217,15 @@ UI.Component.parented = function () { var comp = UI.DomRange.getContainingComponent(event.currentTarget); var data = comp && getComponentData(comp); updateTemplateInstance(self); - esh.handler.call(data, event, self.templateInstance); + Deps.nonreactive(function () { + // Don't want to be in a deps context, even if we were somehow + // triggered synchronously in an existing deps context + // (the `blur` event can do this). + // XXX we should probably do what Spark did and block all + // event handling during our DOM manip. Many apps had weird + // unanticipated bugs until we did that. + esh.handler.call(data, event, self.templateInstance); + }); }; self.dom.on(esh.events, esh.selector, wrappedHandler);