fix: remove click listener for opening popup (#4700)
* fix: remove click listener for oening popup * fix
This commit is contained in:
parent
de6371aac4
commit
00e30ca0e4
@ -1520,6 +1520,14 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
|
|
||||||
removePointer = (event: React.PointerEvent<HTMLElement> | PointerEvent) => {
|
removePointer = (event: React.PointerEvent<HTMLElement> | PointerEvent) => {
|
||||||
this.lastPointerUp = event;
|
this.lastPointerUp = event;
|
||||||
|
|
||||||
|
if (
|
||||||
|
this.hitLinkElement &&
|
||||||
|
!this.state.selectedElementIds[this.hitLinkElement.id]
|
||||||
|
) {
|
||||||
|
this.redirectToLink();
|
||||||
|
}
|
||||||
|
|
||||||
// remove touch handler for context menu on touch devices
|
// remove touch handler for context menu on touch devices
|
||||||
if (event.pointerType === "touch" && touchTimeout) {
|
if (event.pointerType === "touch" && touchTimeout) {
|
||||||
clearTimeout(touchTimeout);
|
clearTimeout(touchTimeout);
|
||||||
@ -2404,12 +2412,6 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private attachLinkListener = () => {
|
|
||||||
this.canvas?.addEventListener("click", this.redirectToLink);
|
|
||||||
};
|
|
||||||
private detachLinkListener = () => {
|
|
||||||
this.canvas?.removeEventListener("click", this.redirectToLink);
|
|
||||||
};
|
|
||||||
|
|
||||||
private handleCanvasPointerMove = (
|
private handleCanvasPointerMove = (
|
||||||
event: React.PointerEvent<HTMLCanvasElement>,
|
event: React.PointerEvent<HTMLCanvasElement>,
|
||||||
@ -2654,10 +2656,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
) {
|
) {
|
||||||
setCursor(this.canvas, CURSOR_TYPE.POINTER);
|
setCursor(this.canvas, CURSOR_TYPE.POINTER);
|
||||||
showHyperlinkTooltip(this.hitLinkElement, this.state);
|
showHyperlinkTooltip(this.hitLinkElement, this.state);
|
||||||
this.attachLinkListener();
|
|
||||||
} else {
|
} else {
|
||||||
hideHyperlinkToolip();
|
hideHyperlinkToolip();
|
||||||
this.detachLinkListener();
|
|
||||||
if (
|
if (
|
||||||
hitElement &&
|
hitElement &&
|
||||||
hitElement.link &&
|
hitElement.link &&
|
||||||
|
@ -321,7 +321,6 @@ export const isPointHittingLinkIcon = (
|
|||||||
x < linkX + threshold + linkWidth &&
|
x < linkX + threshold + linkWidth &&
|
||||||
y > linkY - threshold &&
|
y > linkY - threshold &&
|
||||||
y < linkY + linkHeight + threshold;
|
y < linkY + linkHeight + threshold;
|
||||||
|
|
||||||
return hitLink;
|
return hitLink;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user