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
@@ -175,7 +175,7 @@ function HandleComponent(
return;
}
const doc = getHostForElement(event.target as HTMLElement);
const doc = getHostForElement(event.target);
const isValidConnectionHandler = isValidConnection || isValidConnectionStore;
const { connection, isValid } = XYHandle.isValid(event.nativeEvent, {
handle: {
+2 -2
View File
@@ -131,7 +131,7 @@ export function Pane({
return;
}
(event.target as Element)?.setPointerCapture?.(event.pointerId);
(event.target as Partial<Element> | null)?.setPointerCapture?.(event.pointerId);
selectionStarted.current = true;
selectionInProgress.current = false;
@@ -230,7 +230,7 @@ export function Pane({
return;
}
(event.target as Element)?.releasePointerCapture?.(event.pointerId);
(event.target as Partial<Element>)?.releasePointerCapture?.(event.pointerId);
const { userSelectionRect } = store.getState();
// We only want to trigger click functions when in selection mode if