feat(selection): find react-flow parent from event target instead of document

This commit is contained in:
Christopher Möller
2020-10-06 14:19:43 +02:00
parent 0045058295
commit bb2675a1ea
+1 -1
View File
@@ -12,7 +12,7 @@ type UserSelectionProps = {
};
function getMousePosition(event: React.MouseEvent): XYPosition | void {
const reactFlowNode = document.querySelector('.react-flow');
const reactFlowNode = (event.target as Element).closest('.react-flow');
if (!reactFlowNode) {
return;
}