diff --git a/change/@microsoft-fast-element-74afe8a2-ec05-4780-8034-5c2ea436d82e.json b/change/@microsoft-fast-element-74afe8a2-ec05-4780-8034-5c2ea436d82e.json new file mode 100644 index 00000000000..57853f391d7 --- /dev/null +++ b/change/@microsoft-fast-element-74afe8a2-ec05-4780-8034-5c2ea436d82e.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Moves handleEvent from a class property into a closure in children.ts to remove non-standard observer.target property assignment", + "packageName": "@microsoft/fast-element", + "email": "email not defined", + "dependentChangeType": "none" +} diff --git a/packages/fast-element/src/templating/children.ts b/packages/fast-element/src/templating/children.ts index dce1c524d95..eea09735dad 100644 --- a/packages/fast-element/src/templating/children.ts +++ b/packages/fast-element/src/templating/children.ts @@ -65,12 +65,14 @@ export class ChildrenDirective extends NodeObservationDirective { + this.updateTarget(this.getSource(target), this.computeNodes(target)); + }; + observer = new MutationObserver(handleEvent); observer.toJSON = noop; target[this.observerProperty] = observer; } - observer.target = target; observer.observe(target, this.options); } @@ -80,7 +82,6 @@ export class ChildrenDirective extends NodeObservationDirective { - const target = observer.target; - this.updateTarget(this.getSource(target), this.computeNodes(target)); - }; } HTMLDirective.define(ChildrenDirective);