From f4ff30e27981d6639649406e7031b52cac1b9dd3 Mon Sep 17 00:00:00 2001 From: DrMint Date: Tue, 1 Nov 2022 03:43:36 +0100 Subject: [PATCH] Fixed pointer issue with Link elements --- src/components/Inputs/Link.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Inputs/Link.tsx b/src/components/Inputs/Link.tsx index 8898229..0f35f14 100644 --- a/src/components/Inputs/Link.tsx +++ b/src/components/Inputs/Link.tsx @@ -1,5 +1,5 @@ import router from "next/router"; -import { PointerEventHandler, useState } from "react"; +import { MouseEventHandler, useState } from "react"; import { isDefined } from "helpers/others"; interface Props { @@ -8,7 +8,7 @@ interface Props { allowNewTab?: boolean; alwaysNewTab?: boolean; children: React.ReactNode; - onClick?: PointerEventHandler; + onClick?: MouseEventHandler; onFocusChanged?: (isFocused: boolean) => void; disabled?: boolean; } @@ -28,19 +28,19 @@ export const Link = ({ return (
{ + onMouseLeave={() => { setIsValidClick(false); onFocusChanged?.(false); }} onContextMenu={(event) => event.preventDefault()} - onPointerDown={(event) => { + onMouseDown={(event) => { if (!disabled) { event.preventDefault(); onFocusChanged?.(true); setIsValidClick(true); } }} - onPointerUp={(event) => { + onMouseUp={(event) => { onFocusChanged?.(false); if (!disabled) { if (isDefined(onClick)) {