aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index 1a00c0bfb..f160df6f7 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -592,6 +592,14 @@ export function lightOrDark(color: any) {
}
}
+export function hasDescendantTarget(x: number, y: number, target: HTMLDivElement | null) {
+ let entered = false;
+ for (let child = document.elementFromPoint(x, y); !entered && child; child = child.parentElement) {
+ entered = entered || child === target;
+ }
+ return entered;
+}
+
export function setupMoveUpEvents(
target: object,
e: React.PointerEvent,