Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Commit

Permalink
test guard
Browse files Browse the repository at this point in the history
  • Loading branch information
tinkertrain committed Feb 4, 2022
1 parent 2a129b1 commit 7c0a44e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utilities/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ export const isNodeWithinViewport = options => {
export function nodesHaveSameParent(parentSelector, node1, node2) {
if (!parentSelector || !node1 || !node2) return false

//for testing
if (!node1.closest) {
return false
}

const parent1 = node1.closest(parentSelector)
const parent2 = node2.closest(parentSelector)

Expand Down

0 comments on commit 7c0a44e

Please sign in to comment.