fix: make link icon clickable in mobile (#4736)

This commit is contained in:
Aakansha Doshi 2022-02-07 17:24:51 +05:30 committed by GitHub
parent c3f6d6d344
commit 9be6243873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]