Skip to main content

Bug Tracker

Side navigation

#10420 closed bug (fixed)

Opened October 04, 2011 07:24PM UTC

Closed October 26, 2011 08:53PM UTC

Last modified April 28, 2012 03:21PM UTC

MouseWheel

Reported by: anonymous Owned by: dmethvin
Priority: blocker Milestone: 1.7
Component: misc Version: 1.7b1
Keywords: Cc:
Blocked by: Blocking:
Description

I have been using https://github.com/brandonaaron/jquery-mousewheel for years and now it`s broken.

If I log event ( console.log(delta, deltaX, deltaY); ) then output is -

Firefox: 0 0 0

Chrome: 0 0 -1

(btw, works fine for jQuery 1.6.4 and output is, for example: -1 0 -1)

Attachments (0)
Change History (17)

Changed October 04, 2011 07:35PM UTC by timmywil comment:1

component: unfiledmisc
priority: undecidedlow
resolution: → invalid
status: newclosed

Please file a bug with jQuery mousewheel or you can provide a reduced test case that does not include plugins to indicate an issue with jQuery core.

Changed October 04, 2011 08:44PM UTC by anonymous comment:2

Demos:

Not working - http://jsfiddle.net/Ly9x3/

Working - http://jsfiddle.net/Ly9x3/1/

I would like to find the root of the problem but I only can see that after fixing event (e.g., event = $.event.fix(orgEvent); ) there are no such attributes as wheelDelta OR detail so this plugin, obviously, fails.

An I have no idea what`s going on under that magical $.event.fix

Changed October 05, 2011 03:22AM UTC by dmethvin comment:3

resolution: invalid
status: closedreopened

I'm going to reopen this, as it's a result of the jQuery.event.fix refactoring in 1.7b1. The solution should be simple, we just need to have the plugin get its values from origEvent rather than assuming they were copied to event. Another solution would be to put the properties onto jQuery.event.fixProps but simpler seems better.

Changed October 05, 2011 03:22AM UTC by dmethvin comment:4

owner: → dmethvin
status: reopenedassigned

Changed October 05, 2011 03:23AM UTC by dmethvin comment:5

milestone: None1.7
priority: lowblocker

Changed October 15, 2011 11:21PM UTC by JorisDebonnet comment:6

_comment0: Just curious: is it absolutely not an option to add mousewheel support to jquery (without addons)? A .mousewheelup() and .mousewheeldown() event would really look great on the list on http://api.jquery.com/category/events/mouse-events/ :) \ \ After all, pretty much every mouse has a scrollwheel. jQuery already normalizes the event.which property, which is great; it does the same for 'keyCode'; and in my opinion a mouse's scroll wheel is not that exotic, it's probably >99% as common as a keyboard and a mouse. Does it not deserve a spot within jQuery? 1318720972676653
_comment1: Just curious: is it absolutely not an option to add mousewheel support to jquery (without addons)? A .mousewheelup() and .mousewheeldown() event would really look great on the list on http://api.jquery.com/category/events/mouse-events/ :) \ \ After all, pretty much every mouse has a scrollwheel. jQuery already normalizes the event.which property, which is great; it does the same for 'keyCode'. In my opinion a mouse's scroll wheel is not that exotic, it's probably >99% as common as a keyboard and a mouse. Does it not deserve the same attention? 1318721214716279

Just curious: is it absolutely not an option to add mousewheel support to jquery (without addons)? A .mousewheelup() and .mousewheeldown() event would really look great on the list on http://api.jquery.com/category/events/mouse-events/ :)

After all, pretty much every mouse has a scrollwheel. jQuery already normalizes the event.which property, which is great; and it does the same for a keyboard's 'charCode'. In my opinion a mouse's scroll wheel is not so unusual: it's probably 99% as common as a keyboard and a mouse (even laptops have it). People use it all the time, and many applications have a good use for it.

Does it not deserve the same attention as the mouses' and keyboards' events?

Changed October 16, 2011 12:07AM UTC by JorisDebonnet comment:7

_comment0: As for the original issue: I changed the original fiddle to exclude the addon. This way perhaps it's easier to test against. \ \ http://jsfiddle.net/Ly9x3/5/1318723691181486

As for the original issue: I changed the original fiddle to exclude the addon. This way perhaps it's easier to test against.

http://jsfiddle.net/Ly9x3/5/

It is using 1.6.4, so change to jQuery (edge) to see it break.

Changed October 26, 2011 06:31PM UTC by anonymous comment:8

It also appears that $.event.handler has been renamed $.event.dispatch - by changing the references in the plugin from event to orgEvent and changing the return value to $.event.dispatch.apply(this, args); The plugin starts working again

Changed October 26, 2011 08:53PM UTC by dmethvin comment:9

resolution: → fixed
status: assignedclosed

I've put together a patch that seems to work and submitted it to Brandon:

https://github.com/brandonaaron/jquery-mousewheel/pull/15

My (hopefully) fixed copy is here if you'd like to try it, please let me know if you have any issues:

https://raw.github.com/dmethvin/jquery-mousewheel/fix-17-origEvent/jquery.mousewheel.js

@JorisDebonnet: That test case is not quite right since you are looking at the jQuery normalized (fixed) event object and not the native browser event.originalEvent object that has the browser-specific mousewheel values. Our goal here is to avoid copying properties that only the plugin needs.

Changed October 27, 2011 02:00PM UTC by cousins217 comment:10

With your version I get:

Uncaught TypeError: Cannot call method 'apply' of undefined ($.event.handle is undefined at least in the latest Chrome)

The version you posted needs:

return $.event.handle.apply(this, args);

changed to

return $.event.dispatch.apply(this, args);

And that seems to get things working again in 1.7 - it will however break < 1.7. I am not sure why handle went and dispatch came in but I imagine its to do with some 1.7 refactoring.

Replying to [comment:9 dmethvin]:

I've put together a patch that seems to work and submitted it to Brandon: https://github.com/brandonaaron/jquery-mousewheel/pull/15 My (hopefully) fixed copy is here if you'd like to try it, please let me know if you have any issues: https://raw.github.com/dmethvin/jquery-mousewheel/fix-17-origEvent/jquery.mousewheel.js @JorisDebonnet: That test case is not quite right since you are looking at the jQuery normalized (fixed) event object and not the native browser event.originalEvent object that has the browser-specific mousewheel values. Our goal here is to avoid copying properties that only the plugin needs.

Changed October 27, 2011 02:03PM UTC by dmethvin comment:11

Sorry, I should have also specified that you must use the git version instead of rc1, it's at http://code.jquery.com/jquery-git.js .

Changed November 06, 2011 03:04PM UTC by heylinus@gmail.com comment:12

Not working in Firefox on MacOSX

console.log(delta, deltaX, deltaY);

outputed:

0 0 0

jquery 1.7

jquery-mousewheel git

firefox 7.0.1

mac os x 10.6.6

Also has the same problem in Firefox 7 & Opera 11.50 on Windows XP.

webkit(chrome, safari) is fine.

Changed November 06, 2011 04:14PM UTC by rwaldron comment:13

Replying to [comment:12 heylinus@…]:

Not working in Firefox on MacOSX console.log(delta, deltaX, deltaY); outputed: 0 0 0 jquery 1.7 jquery-mousewheel git firefox 7.0.1 mac os x 10.6.6 Also has the same problem in Firefox 7 & Opera 11.50 on Windows XP. webkit(chrome, safari) is fine.

Please provide a complete reduced test case on jsFiddle to help us assess your ticket!

Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/

Open the link and click to "Fork" (in the top menu) to get started.

Changed November 08, 2011 06:10AM UTC by heylinus comment:14

Replying to [comment:13 rwaldron]:

Please provide a complete reduced test case on jsFiddle to help us assess your ticket! Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

http://jsfiddle.net/Ly9x3/1/

firefox 7.0.1 (Mac 10.6.6)

1.6.4 and lower working

1.7 and 'edge' return 0 0 0

firefox 7.0.1 (WinXP x86)

1.6.4 and lower return 1 0 1(-1 0 -1) no horizontal scroll

1.7, and 'edge' return 0 0 0

firefox 7.0.1 (Win7 x64)

1.6.4 and lower working

1.7, and 'edge' return 0 0 0

Changed November 08, 2011 01:51PM UTC by dmethvin comment:15

You'll need an update to the mousewheel plugin; I put in a pull request to Brandon and you can track it here:

https://github.com/brandonaaron/jquery-mousewheel/pull/17

Changed April 20, 2012 09:19AM UTC by anonymous comment:16

Replying to [comment:15 dmethvin]:

You'll need an update to the mousewheel plugin; I put in a pull request to Brandon and you can track it here: https://github.com/brandonaaron/jquery-mousewheel/pull/17

Works excellent in Windows Firefox and Mac

Changed April 28, 2012 03:21PM UTC by anonymous comment:17

A fix for any script using the movement of the mousewheel is (where e is the event):

if(!e.detail && !e.wheelDelta){e = e.originalEvent;}