fix(onEdgeUpdate): check if handle is target or source by classname fixes #982
This commit is contained in:
@@ -98,12 +98,14 @@ export function onMouseDown(
|
||||
onConnectEnd?: OnConnectEndFunc
|
||||
): void {
|
||||
const reactFlowNode = (event.target as Element).closest('.react-flow');
|
||||
const elementBelow = document.elementFromPoint(event.clientX, event.clientY);
|
||||
const elementBelowIsTarget = elementBelow?.classList.contains('target') || false;
|
||||
|
||||
if (!reactFlowNode) {
|
||||
return;
|
||||
}
|
||||
|
||||
const handleType = isTarget ? 'target' : 'source';
|
||||
const handleType = elementBelowIsTarget ? 'target' : 'source';
|
||||
const containerBounds = reactFlowNode.getBoundingClientRect();
|
||||
let recentHoveredHandle: Element;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user