Khan / Khan/live-editor

mouseScrolled in PJS program scrolls entire page

Open
#443 5 comments 0 reactions 0 assignees View on GitHub
pjs
Dominant language
JavaScript
Stars
776
Forks
180
PR merge metrics
No merged PRs in 30d

Description

The canvas should trap mouse scroll events. Currently the only way to do this is

```
mouseScrolled = function() {
// jshint noarg:false
arguments.callee.caller.arguments[0].preventDefault();
};
```

which is a horrific abuse of `arguments` ~~and doesn't work in Firefox (I think the `callee.caller` function would need to return false or something)~~.

Listening to `mouseScrolled` would be useful for many things, but is basically useless because of this bug.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the mouseScrolled event entry point and trace how scroll events from the canvas reach the page. Verify the event can be handled without the arguments.callee workaround, including Firefox behavior. Done means listening to mouseScrolled prevents the page from scrolling while preserving useful canvas scroll handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.