diff --git a/cursor.jsx b/cursor.jsx index 0577dd2..29a7b3d 100644 --- a/cursor.jsx +++ b/cursor.jsx @@ -43,9 +43,11 @@ export function CursorProvider ({ hidden, enabled, children }) { }; }, []); + const isTouchDevice = "ontouchstart" in window; + useEffect(() => { const htmlElement = document.documentElement; - if (isCursorEnabled) { + if (isCursorEnabled & !isTouchDevice) { htmlElement.classList.add('custom-cursor-enabled-env'); } else { htmlElement.classList.remove('custom-cursor-enabled-env'); @@ -55,7 +57,7 @@ export function CursorProvider ({ hidden, enabled, children }) { return ( <> - {isCursorEnabled ? + {isCursorEnabled & !isTouchDevice ?