Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: backgrounds/waves #173

Closed
1 task done
omshejul opened this issue Mar 27, 2025 · 1 comment
Closed
1 task done

[BUG]: backgrounds/waves #173

omshejul opened this issue Mar 27, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@omshejul
Copy link

Describe the issue

When using waves with long page, it is causing the dot to move too far down when scrolling
Changes made to fix cursor dot behavior:
Changes made to fix cursor dot behavior:

  1. Changed mouse event handler to use clientX/clientY instead of pageX/pageY
    • clientX/clientY provides viewport-relative coordinates
    • This ensures the cursor dot stays aligned with the mouse regardless of scroll position
    • Works with the fixed positioning of the Waves component
  2. Removed window.scrollY offset from mouse.y calculation
    • Changed: mouse.y = y - b.top + window.scrollY
    • To: mouse.y = y - b.top
    • This prevents the cursor dot from moving too far down when scrolling

Reproduction Link

No response

Steps to reproduce

Wrap Waves in fixed:



Changes:
❌ updateMouse(e.pageX, e.pageY);
✅ updateMouse(e.clientX, e.clientY);

❌ mouse.y = y - b.top + window.scrollY
✅ mouse.y = y - b.top;

Validations

  • I have checked other issues to see if my issue was already reported or addressed
@omshejul omshejul added the bug Something isn't working label Mar 27, 2025
@DavidHDev
Copy link
Owner

Updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants