feat(selection): find react-flow parent from event target instead of document
This commit is contained in:
@@ -12,7 +12,7 @@ type UserSelectionProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function getMousePosition(event: React.MouseEvent): XYPosition | void {
|
function getMousePosition(event: React.MouseEvent): XYPosition | void {
|
||||||
const reactFlowNode = document.querySelector('.react-flow');
|
const reactFlowNode = (event.target as Element).closest('.react-flow');
|
||||||
if (!reactFlowNode) {
|
if (!reactFlowNode) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user