fix: actually remove all old elements

This commit is contained in:
cha0s 2019-04-22 14:36:39 -05:00
parent 319822d93d
commit 40f690e4a1

View File

@ -127,7 +127,13 @@ export class TextNodeRenderer extends Proton.BaseRender {
this.stage = stage;
const promise = stage.findUiElement(selector);
promise.then((element) => {
this.constructor.clearFreeList();
if (this.parent) {
const freeList = this.constructor.freeList;
while (freeList.length > 0) {
const node = freeList.pop();
this.parent.removeChild(node);
}
}
this.parent = element;
});
}