Skip to content

Commit

Permalink
fix(dom): treat head and body selectors as a special case
Browse files Browse the repository at this point in the history
  • Loading branch information
tchak committed Sep 1, 2023
1 parent 934a977 commit b3b32ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/actions/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,11 @@ function isMaterializedAction(action: Action | MaterializedAction): action is Ma
}

function getTargetElements(element: Element, selector: string) {
if (selector == 'head') {
return [element.ownerDocument.head];
} else if (selector == 'body') {
return [element.ownerDocument.body];
}
return [...element.querySelectorAll(selector)];
}

Expand Down

0 comments on commit b3b32ff

Please sign in to comment.