Skip to content

Commit

Permalink
fix: TypeError: parent.append is not a function
Browse files Browse the repository at this point in the history
fakedom only have insertBefore and appendChild
  • Loading branch information
linonetwo committed Mar 28, 2024
1 parent 815e24c commit 2eea0bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin-name/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ExampleWidget extends Widget {
const containerElement = $tw.utils.domMaker('p', {
text: 'This is a widget!',
});
nextSibling === null ? parent.append(containerElement) : nextSibling.before(containerElement);
parent.insertBefore(containerElement, nextSibling);
this.domNodes.push(containerElement);
}
}
Expand Down

0 comments on commit 2eea0bc

Please sign in to comment.