aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Utils.ts2
-rw-r--r--src/client/views/nodes/DocumentView.tsx5
2 files changed, 3 insertions, 4 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index 852a00406..f160df6f7 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -592,7 +592,7 @@ export function lightOrDark(color: any) {
}
}
-export function isTarget(x: number, y: number, target: HTMLDivElement | null) {
+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;
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index b9ca460b9..e99b0a155 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -9,8 +9,7 @@ import { ScriptField } from '../../../fields/ScriptField';
import { BoolCast, Cast, NumCast, ScriptCast, StrCast } from "../../../fields/Types";
import { GetEffectiveAcl, TraceMobx } from '../../../fields/util';
import { MobileInterface } from '../../../mobile/MobileInterface';
-import { GestureUtils } from '../../../pen-gestures/GestureUtils';
-import { emptyFunction, isTarget as hasDescendantTarget, OmitKeys, returnFalse, returnVal, Utils } from "../../../Utils";
+import { emptyFunction, hasDescendantTarget, OmitKeys, returnFalse, returnVal, Utils } from "../../../Utils";
import { GooglePhotos } from '../../apis/google_docs/GooglePhotosClientUtils';
import { Docs, DocUtils } from "../../documents/Documents";
import { DocumentType } from '../../documents/DocumentTypes';
@@ -832,7 +831,7 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps
onPointerDown={this.onPointerDown}
onClick={this.onClick}
onPointerEnter={e => !SnappingManager.GetIsDragging() && Doc.BrushDoc(this.props.Document)}
- onPointerLeave={e => hasDescendantTarget(e.nativeEvent.x, e.nativeEvent.y, this.ContentDiv) && Doc.UnBrushDoc(this.props.Document)}
+ onPointerLeave={e => !hasDescendantTarget(e.nativeEvent.x, e.nativeEvent.y, this.ContentDiv) && Doc.UnBrushDoc(this.props.Document)}
style={{
borderRadius: this.borderRounding,
pointerEvents: this.pointerEvents,