Skip to content

Commit

Permalink
fix: make link icon clickable in mobile (excalidraw#4736)
Browse files Browse the repository at this point in the history
  • Loading branch information
ad1992 authored Feb 7, 2022
1 parent c3f6d6d commit 9be6243
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,20 @@ class App extends React.Component<AppProps, AppState> {

removePointer = (event: React.PointerEvent<HTMLElement> | 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]
Expand Down

0 comments on commit 9be6243

Please sign in to comment.