jquery / jquery/jquery-mousewheel
Add a new `wheel` event, deprecate the `mousewheel` one
@mgol is already working on this.
Since Mar 17, 2025.
- Dominant language
- JavaScript
- Stars
- 3.9k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
Let's discuss plans for jQuery Mousewheel 4.0.0.
At the very least, I'd like to align browser support with jQuery 4.x. Also, all browsers now support the wheel event, so we can drop other underlying events.
There exists a 4.0.x branch from 2014. Some improvements could be backported, but the branch also added some code for throttling/debouncing, which I'd consider out of scope at this point.
However, this plugin follows the legacy mousewheel event delta sign which is the opposite sign to the native wheel event and it'd be good to align. The 4.0.x branch did that, but just reversing the sign on an existing event would be too disruptive. I see two options:
- Make this plugin also expose the
wheelevent, mark themousewheelone as deprecated but keep it. - Deprecate this plugin, pointing people to my
jquery-wheel. I'd be happy to donate it to OpenJSF and backport any code from jQuery Mousewheel that makes sense for that event. - Despite the issues this plugin solves, deprecate it anyway.
I'm making jQuery UI not depend on this plugin in https://github.com/jquery/jquery-ui/pull/2338, so at least that shouldn't block us.
The main reason why we I'm thinking about not deprecating the plugin without a replacement is that the native wheel event may report deltas in pixels, lines or pages. Chrome may report pixels or pages, Firefox can report all three depending on input devices. This plugin can be useful to get some pixel-based normalization; as long as browsers don't provide that out of the box, I see some value in this plugin. There are some discussions about always exposing pixels, perhaps in addition to other modes, in https://github.com/w3c/pointerevents/issues/592, but so far the discussion has stalled.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.