Skip to content

Commit

Permalink
Fix: fix nodes added in a tree in Safari
Browse files Browse the repository at this point in the history
FILTER_REJECT rejects nodes that might have children
of type form-associated custom elements. Instead, use FILTER_SKIP.
This option traverses the children in such cases.
  • Loading branch information
sipris authored and calebdwilliams committed Aug 23, 2022
1 parent 09da720 commit d72172c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mutation-observers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function observerCallback(mutationList: MutationRecord[]) {
const walker = document.createTreeWalker(node, NodeFilter.SHOW_ELEMENT, {
acceptNode(node: ICustomElement): number {
return internalsMap.has(node) && !formElements?.has(node) ?
NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;
NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
}
});

Expand Down

0 comments on commit d72172c

Please sign in to comment.