Closed shivankacker closed 5 months ago
Example:
const [mouseDownTime, setMouseDownTime] = useState(0); const handleClick = (e: any) => { e.preventDefault(); e.stopPropagation(); // check if it was a click or a drag if (Date.now() - mouseDownTime < 100) { window.location.href = e.currentTarget.href; } }; const handleMouseDown = (e: any) => { e.preventDefault(); setMouseDownTime(Date.now()); }
<Link href={"/"} draggable={false} onMouseDown={handleMouseDown} onClick={handleClick} > Link </Link>
https://github.com/Skyleen77/next-nprogress-bar/assets/23238460/2c36c43d-b618-46ca-ac0f-755cd74550c9
Am I doing something wrong? Or is this an issue?
Closing this as this looks like a duplicate of https://github.com/Skyleen77/next-nprogress-bar/issues/52. That fixed the issue for me
Example:
https://github.com/Skyleen77/next-nprogress-bar/assets/23238460/2c36c43d-b618-46ca-ac0f-755cd74550c9
Am I doing something wrong? Or is this an issue?