refactor(svelte): use correct id for handle data-id attr
This commit is contained in:
@@ -134,7 +134,7 @@ The Handle component is the part of a node that can be used to connect nodes.
|
|||||||
data-handleid={handleId}
|
data-handleid={handleId}
|
||||||
data-nodeid={nodeId}
|
data-nodeid={nodeId}
|
||||||
data-handlepos={position}
|
data-handlepos={position}
|
||||||
data-id="{flowId}-{nodeId}-{id || null}-{type}"
|
data-id="{$flowId}-{nodeId}-{id || null}-{type}"
|
||||||
class={cc([
|
class={cc([
|
||||||
'svelte-flow__handle',
|
'svelte-flow__handle',
|
||||||
`svelte-flow__handle-${position}`,
|
`svelte-flow__handle-${position}`,
|
||||||
|
|||||||
@@ -260,9 +260,10 @@ function isValidHandle(
|
|||||||
}: IsValidParams
|
}: IsValidParams
|
||||||
) {
|
) {
|
||||||
const isTarget = fromType === 'target';
|
const isTarget = fromType === 'target';
|
||||||
const handleDomNode = doc.querySelector(
|
const handleDomNode = handle
|
||||||
`.${lib}-flow__handle[data-id="${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}"]`
|
? doc.querySelector(`.${lib}-flow__handle[data-id="${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}"]`)
|
||||||
);
|
: null;
|
||||||
|
|
||||||
const { x, y } = getEventPosition(event);
|
const { x, y } = getEventPosition(event);
|
||||||
const handleBelow = doc.elementFromPoint(x, y);
|
const handleBelow = doc.elementFromPoint(x, y);
|
||||||
// we always want to prioritize the handle below the mouse cursor over the closest distance handle,
|
// we always want to prioritize the handle below the mouse cursor over the closest distance handle,
|
||||||
|
|||||||
Reference in New Issue
Block a user