Skip to content

fix: mousemove handler uses global event instead of arrow function parameter e#4

Open
Saurabh0Gupta wants to merge 1 commit into
sheryianscodingschool:mainfrom
Saurabh0Gupta:fix/mousemove-event-parameter
Open

fix: mousemove handler uses global event instead of arrow function parameter e#4
Saurabh0Gupta wants to merge 1 commit into
sheryianscodingschool:mainfrom
Saurabh0Gupta:fix/mousemove-event-parameter

Conversation

@Saurabh0Gupta

Copy link
Copy Markdown

In src/Utils.js line 576, the mousemove listener declares parameter e
but reads event.clientX / event.clientY — relying on the non-standard
global window.event instead.

This causes:

  • TypeError: Cannot read properties of undefined (reading 'clientX')
    in environments where window.event is unavailable
  • mousem shader uniform stuck at vec2(0.0, 0.0) — mouse distortion broken
  • Naturally fails in Firefox < 66 and strict module contexts

Fix :-
// Before
const mouseX = event.clientX
const mouseY = event.clientY

// After
const mouseX = e.clientX
const mouseY = e.clientY

@Saurabh0Gupta Saurabh0Gupta force-pushed the fix/mousemove-event-parameter branch from 607ca18 to e26882a Compare May 4, 2026 15:08
@Saurabh0Gupta

Copy link
Copy Markdown
Author

@sheryianscodingschool Kindly review the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant