@@ -2703,12 +2703,12 @@ export const PropertyEffects = dedupingMixin(superClass => {
2703
2703
// effects are run; if this template was not nested in another
2704
2704
// template, use the root template (the first stamped one) as the
2705
2705
// parent. Note, `parent` is the `templateInfo` instance for this
2706
- // template's containing template, which was set up in
2707
- // `applyTemplateContent`. While a given template's `parent` is
2708
- // given , it is only added to the parent list at the point that it is
2709
- // being bound, since a template may or may not ever be stamped, and
2710
- // may be stamped more than once (in which case it will be in the
2711
- // tree more than once).
2706
+ // template's parent ( containing) template, which was set up in
2707
+ // `applyTemplateContent`. While a given template's `parent` is set
2708
+ // apriori , it is only added to the parent list at the point that it
2709
+ // is being bound, since a template may or may not ever be stamped,
2710
+ // and may be stamped more than once (in which case instances of the
2711
+ // template info will be in the tree under its parent more than once).
2712
2712
const parent = templateInfo . parent || this . __templateInfo ;
2713
2713
const previous = parent . lastChild ;
2714
2714
parent . lastChild = templateInfo ;
@@ -2807,7 +2807,7 @@ export const PropertyEffects = dedupingMixin(superClass => {
2807
2807
* @protected
2808
2808
*/
2809
2809
_removeBoundDom ( dom ) {
2810
- // Unlink template info; Note that while the child is unlinked from its
2810
+ // Unlink template info; Note that while the child is unlinked from its
2811
2811
// parent list, a template's `parent` reference is never removed, since
2812
2812
// this is is determined by the tree structure and applied at
2813
2813
// `applyTemplateContent` time.
@@ -2964,10 +2964,12 @@ export const PropertyEffects = dedupingMixin(superClass => {
2964
2964
// onto the parent (dom-if/repeat element)'s nodeInfo
2965
2965
if ( removeNestedTemplates && ( isDomIf || isDomRepeat ) ) {
2966
2966
parent . removeChild ( node ) ;
2967
- nodeInfo . parentInfo . templateInfo = nestedTemplateInfo ;
2968
- // Ensure the parent dom-if/repeat is noted since it now has bindings;
2969
- // it may not have been if it did not have its own bindings
2967
+ // Use the parent's nodeInfo (for the dom-if/repeat) to record the
2968
+ // templateInfo, and use that for any host property bindings below
2970
2969
nodeInfo = nodeInfo . parentInfo ;
2970
+ nodeInfo . templateInfo = nestedTemplateInfo ;
2971
+ // Ensure the parent dom-if/repeat is noted since it now may have host
2972
+ // bindings; it may not have been if it did not have its own bindings
2971
2973
nodeInfo . noted = true ;
2972
2974
noted = false ;
2973
2975
}
0 commit comments