Skip to content

Commit

Permalink
fix(domFns): Fix "cannot read property 'call' of undefined"
Browse files Browse the repository at this point in the history
Fixes #300, #303
  • Loading branch information
STRML committed Nov 27, 2017
1 parent b9400c2 commit 176f691
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/utils/domFns.js
Expand Up @@ -19,8 +19,12 @@ export function matchesSelector(el: Node, selector: string): boolean {
});
}

// Might not be found entirely (not an Element?) - in that case, bail
// $FlowIgnore: Doesn't think elements are indexable
return el[matchesSelectorFunc].call(el, selector);
if (!isFunction(el[matchesSelectorFunc])) return false;

// $FlowIgnore: Doesn't think elements are indexable
return el[matchesSelectorFunc](selector);
}

// Works up the tree to the draggable itself attempting to match selector.
Expand Down

0 comments on commit 176f691

Please sign in to comment.