Skip to content

Commit

Permalink
Fixes check for rootNode
Browse files Browse the repository at this point in the history
  • Loading branch information
jspangler committed Sep 22, 2020
1 parent 7a2eef7 commit d904d73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dom-utils/contains.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// @flow
export default function contains(parent: Element, child: Element) {
// $FlowFixMe: hasOwnProperty doesn't seem to work in tests
const rootNode = child.getRootNode && child.getRootNode();
isShadow = Boolean(rootNode && rootNode.host);
const rootNode = child.getRootNode && child.getRootNode(),
isShadow = Boolean(rootNode && rootNode.host);

// First, attempt with faster native method
if (parent.contains(child)) {
Expand Down

0 comments on commit d904d73

Please sign in to comment.