Cuberto / mouse-follower

A powerful javascript library to create amazing and smooth effects for the mouse cursor on your website.
MIT License
724 stars 60 forks source link

Sticky effect data attribute error in React #5

Open Giuseppetm opened 2 years ago

Giuseppetm commented 2 years ago

Hello, using sticky effect via data attribute causes this error:

image

<div data-cursor-stick>Hover me to stick cursor!</div>

Details

Mouse-follower version: 1.0.7 (I tried 1.0.3 too, same error)

Drafteed commented 2 years ago

@Giuseppetm Hmmm, I can't reproduce that. Everything is working fine.

Giuseppetm commented 2 years ago

@Giuseppetm Hmmm, I can't reproduce that. Everything is working fine.

Maybe this is caused by React; I'll let you know if I find something about this.

sisheng1998 commented 2 years ago

Hi there, I did face the same issue when using React, but I manage to fix this issue by replacing

<div data-cursor-stick>Hover me to stick cursor!</div>

with

<div data-cursor-stick=".stick-me" className="stick-me">Hover me to stick cursor!</div>

Giuseppetm commented 1 year ago

Current version of mouse-follower still has this issue (v1.1.2). @sisheng1998 managed to find a temporary fix but looks like it doesn't work anymore.

image

My current fix is this code:

data-cursor-stick={`#stick-lateral-menu-${x}`} id={`stick-lateral-menu-${x}`}

(x is the identifier for your element).

FYI @Drafteed

webankush commented 3 months ago

same problem all fixes are temporary