diff --git a/lib/elements/dom-bind.js b/lib/elements/dom-bind.js index 9613ab9e3e..e02d041a90 100644 --- a/lib/elements/dom-bind.js +++ b/lib/elements/dom-bind.js @@ -13,6 +13,7 @@ import { PropertyEffects } from '../mixins/property-effects.js'; import { OptionalMutableData } from '../mixins/mutable-data.js'; import { GestureEventListeners } from '../mixins/gesture-event-listeners.js'; import { strictTemplatePolicy } from '../utils/settings.js'; +import { wrap } from '../utils/wrap.js'; /** * @constructor @@ -87,7 +88,7 @@ export class DomBind extends domBindBase { } __insertChildren() { - this.parentNode.insertBefore(this.root, this); + wrap(wrap(this).parentNode).insertBefore(this.root, this); } __removeChildren() { diff --git a/lib/elements/dom-if.js b/lib/elements/dom-if.js index f7f41c24f4..a13940ad1a 100644 --- a/lib/elements/dom-if.js +++ b/lib/elements/dom-if.js @@ -14,6 +14,7 @@ import { Debouncer } from '../utils/debounce.js'; import { enqueueDebouncer, flush } from '../utils/flush.js'; import { microTask } from '../utils/async.js'; import { root } from '../utils/path.js'; +import { wrap } from '../utils/wrap.js'; /** * The `` element will stamp a light-dom `