Skip to content

Commit 8f0f57a

Browse files
author
Pavel Klimov
committed
fixed click on touch
1 parent c2743e3 commit 8f0f57a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/canvas/layers/graphLayer/GraphLayer.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ export type TGraphLayerContext = LayerContext & {
2525
graph: Graph;
2626
};
2727

28-
const rootBubblingEventTypes = new Set(["pointerdown", "pointerup", "click", "dblclick", "contextmenu"]);
28+
const rootBubblingEventTypes = new Set([
29+
"pointerdown",
30+
"pointerup",
31+
"click",
32+
"dblclick",
33+
"contextmenu",
34+
"pointercancel",
35+
]);
2936
const rootCapturingEventTypes = new Set(["pointerdown", "pointerup"]);
3037

3138
export type GraphPointerEvent = CustomEvent<{
@@ -317,8 +324,7 @@ export class GraphLayer extends Layer<TGraphLayerProps, TGraphLayerContext> {
317324
}
318325

319326
if (
320-
this.pointerStartEvent &&
321-
getEventDelta(this.pointerStartEvent, event) < 3 &&
327+
(this.canEmulateClick || event.pointerType === "touch") &&
322328
(event.type === "click" || event.type === "dblclick")
323329
) {
324330
this.applyEventToTargetComponent(new PointerEvent(event.type, event), target);

0 commit comments

Comments
 (0)