From c563d5a32759ccbfb9c020bfeb900000dbbaafe0 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Thu, 11 Jul 2019 10:17:12 -0700 Subject: [PATCH] Use a safer flag, based on internal testing. --- lib/mixins/property-effects.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/mixins/property-effects.js b/lib/mixins/property-effects.js index a8bce1fbff..5988b2df8c 100644 --- a/lib/mixins/property-effects.js +++ b/lib/mixins/property-effects.js @@ -2801,8 +2801,16 @@ export const PropertyEffects = dedupingMixin(superClass => { dom.templateInfo = templateInfo; // Setup compound storage, 2-way listeners, and dataHost for bindings setupBindings(this, templateInfo); - // Flush properties into template nodes if already booted - if (this.__dataReady) { + // Flush properties into template nodes; the check on `__dataClientsReady` + // ensures we don't needlessly run effects for an element's initial + // prototypical template stamping since they will happen as a part of the + // first call to `_propertiesChanged`. This flag is set to true + // after running the initial propagate effects, and immediately before + // flushing clients. Since downstream clients could cause stamping on + // this host (e.g. a fastDomIf `dom-if` being forced to render + // synchronously), this flag ensures effects for runtime-stamped templates + // are run at this point during the initial element boot-up. + if (this.__dataClientsReady) { this._runEffectsForTemplate(templateInfo, this.__data, null, false); } return dom;