-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Wheel Scrolling is to slow in FireFox in conjunction with jquery-mousewheel plugin #2823
Comments
I had the same issue, but it has nothing to do with mousewheel i think. I found that Firefox uses a deltaMode of 1, which is scroll per line. So a delta of 3 means 3 lines instead of pixels. I hacked this into the chosen.jquery.js and it made scrolling a lot faster: Chosen.prototype.search_results_mousewheel = function(evt) {
/** Added the factor var and set it's value to 16 when scrolling is line scrolling */
var delta, factor;
if (evt.originalEvent) {
factor = evt.originalEvent.deltaMode === 1 /** DOM_DELTA_LINE */ ? 16 : 1;
delta = factor * evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
}
if (delta != null) {
evt.preventDefault();
if (evt.type === 'DOMMouseScroll') {
delta = delta * 40;
}
return this.search_results.scrollTop(delta + this.search_results.scrollTop());
}
}; |
Patch proposed by storman works perfectly for us. Is it planned to be published in a future release? |
@storeman can you open a pull request with your patch ? |
I don't know coffeescript or how to compile/test it with grunt. I've made a fix which i think should work, but I'm unable to test is, so I don't want to create a pull request. My fix in coffeescript can be found here: |
@storeman So how i fixed that without modifying source code of both plugins - i just do $(..).unmousewheel() in places for each i register .chosen(); One could write simple plugin for that :) If fixing that in the way you did here |
Is reproduced when using in conjunction with jquery-mousewheel plugin.
See https://jsfiddle.net/4Lba076o/
In Chrome scrolling is OK.
In Firefox it's very slow (1px).
Basically, mouse wheel behavior is not utilizing event.deltaFactor (which is non-standard however).
In Firefox jquery-mousewheel transforms event from {deltaY: -42} to {deltaY: -1, deltaFactor: 42}
The text was updated successfully, but these errors were encountered: