diff --git a/.changeset/mean-snakes-shave.md b/.changeset/mean-snakes-shave.md new file mode 100644 index 00000000..1c69a384 --- /dev/null +++ b/.changeset/mean-snakes-shave.md @@ -0,0 +1,5 @@ +--- +'@remote-dom/polyfill': patch +--- + +Ensure the `createText` hook is called when creating a new text node diff --git a/packages/polyfill/source/Document.ts b/packages/polyfill/source/Document.ts index 4c67374c..44285ad7 100644 --- a/packages/polyfill/source/Document.ts +++ b/packages/polyfill/source/Document.ts @@ -50,7 +50,9 @@ export class Document extends ParentNode { } createTextNode(data: any) { - return createNode(new Text(data), this); + const text = createNode(new Text(data), this); + this[HOOKS].createText?.(text as any, String(data)); + return text; } createComment(data: any) {