fix(system): safe check all event target

This commit is contained in:
CRIMX
2024-12-10 12:56:30 +08:00
parent 0f21ec21eb
commit b7b5032c02
9 changed files with 20 additions and 18 deletions
@@ -33,7 +33,7 @@
if (!connectingNodeId) return;
// See of connection landed inside the flow pane
const targetIsPane = (event.target as HTMLDivElement)?.classList.contains('svelte-flow__pane');
const targetIsPane = (event.target as Partial<Element> | null)?.classList?.contains('svelte-flow__pane');
if (targetIsPane && 'clientX' in event && 'clientY' in event) {
const id = getId();
const position = {