Merge pull request #4880 from crimx/patch-2

Fix type check for all event targets
This commit is contained in:
Moritz Klack
2025-01-10 10:27:19 +01:00
committed by GitHub
10 changed files with 27 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 = {