Skip to content

Commit

Permalink
Use a safer flag, based on internal testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Jul 11, 2019
1 parent b5f8a6d commit c563d5a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/mixins/property-effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c563d5a

Please sign in to comment.