From 9be62438736437f3ccfde6d5aa7e5b02600a2d33 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Mon, 7 Feb 2022 17:24:51 +0530 Subject: [PATCH] fix: make link icon clickable in mobile (#4736) --- src/components/App.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 2d482b85..bb64d4b3 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1524,7 +1524,20 @@ class App extends React.Component { removePointer = (event: React.PointerEvent | PointerEvent) => { this.lastPointerUp = event; - + if (this.isMobile) { + const scenePointer = viewportCoordsToSceneCoords( + { clientX: event.clientX, clientY: event.clientY }, + this.state, + ); + const hitElement = this.getElementAtPosition( + scenePointer.x, + scenePointer.y, + ); + this.hitLinkElement = this.getElementLinkAtPosition( + scenePointer, + hitElement, + ); + } if ( this.hitLinkElement && !this.state.selectedElementIds[this.hitLinkElement.id]