Skip to content

Commit

Permalink
Call hook when creating text
Browse files Browse the repository at this point in the history
  • Loading branch information
jakearchibald committed Sep 3, 2024
1 parent c9df29d commit 995d3e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/polyfill/source/Document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 995d3e9

Please sign in to comment.