Skip to content

Commit c563d5a

Browse files
committed
Use a safer flag, based on internal testing.
1 parent b5f8a6d commit c563d5a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/mixins/property-effects.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2801,8 +2801,16 @@ export const PropertyEffects = dedupingMixin(superClass => {
28012801
dom.templateInfo = templateInfo;
28022802
// Setup compound storage, 2-way listeners, and dataHost for bindings
28032803
setupBindings(this, templateInfo);
2804-
// Flush properties into template nodes if already booted
2805-
if (this.__dataReady) {
2804+
// Flush properties into template nodes; the check on `__dataClientsReady`
2805+
// ensures we don't needlessly run effects for an element's initial
2806+
// prototypical template stamping since they will happen as a part of the
2807+
// first call to `_propertiesChanged`. This flag is set to true
2808+
// after running the initial propagate effects, and immediately before
2809+
// flushing clients. Since downstream clients could cause stamping on
2810+
// this host (e.g. a fastDomIf `dom-if` being forced to render
2811+
// synchronously), this flag ensures effects for runtime-stamped templates
2812+
// are run at this point during the initial element boot-up.
2813+
if (this.__dataClientsReady) {
28062814
this._runEffectsForTemplate(templateInfo, this.__data, null, false);
28072815
}
28082816
return dom;

0 commit comments

Comments
 (0)