Skip to content

Commit 176f691

Browse files
committed
fix(domFns): Fix "cannot read property 'call' of undefined"
Fixes react-grid-layout#300, react-grid-layout#303
1 parent b9400c2 commit 176f691

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/utils/domFns.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ export function matchesSelector(el: Node, selector: string): boolean {
1919
});
2020
}
2121

22+
// Might not be found entirely (not an Element?) - in that case, bail
2223
// $FlowIgnore: Doesn't think elements are indexable
23-
return el[matchesSelectorFunc].call(el, selector);
24+
if (!isFunction(el[matchesSelectorFunc])) return false;
25+
26+
// $FlowIgnore: Doesn't think elements are indexable
27+
return el[matchesSelectorFunc](selector);
2428
}
2529

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

0 commit comments

Comments
 (0)