-
Notifications
You must be signed in to change notification settings - Fork 1.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
When dragging the scroll bar, reported direction ist always "right" and stays "right" afterwards #362
Comments
It might be fixed by changing line 2400: FROM:
TO:
But I'm not sure if that causes problems with detection of horizontal scroll direction. |
See my bug report here: locomotivemtl#362
I made another test case with horizontal scrolling and it worked fine with my fix. So I'm proposing this change. Another way would be to limit the check of delta.y / scroll.y respectively delta.x / scroll.x depending on what scroll direction is set upon instantiation. Of course the real question is why dragging the scroll bar reports delta.x / scroll.x difference at all when scrolling is set to vertical. But I'd have to first understand the library better, to find the cause. |
I took a deeper look. The real problem is here:
x is always smaller than _this5.instance.limit.x when vertical scrolling is used. Everywhere else horizontal values are only processed when
|
Before, when used in vertical scrolling, x was always smaller than this.instance.limit.x resulting in the problem described here: locomotivemtl#362 From a performance point of view it is not necessary to do both calculations, as only one scroll direction can apply. Most other function use the same distinction between this.direction === 'horizontal' and 'vertical',
Hello @Jerek0, Just discovered this bug, and can confirm it's always the case. |
I posted a patch 1 year ago. #364 |
@odysseuscm I will have a look 😉 |
@odysseuscm @Jerek0 I can confirm, the patch fix the issue 🎉 , would be nice to merge! |
@Jerek0 would be nice if the fix could be merged and published. |
Hello 👋
Describe the bug
I use the on "scroll" event to determine the scroll direction. When scrolling with the mouse wheel the direction is correctly reported as "up" and "down". When scrolling by dragging the scroll bar, the direction is always reported as "right" and from now on stays "right" whichever way you scroll. Even if you scroll by mouse wheel again.
To Reproduce
I built a test case here: https://kunden.cmcm.info/ls-direction-bug/index.html
Once you drag the scroll bar, the reported direction is always "right".
Expected behavior
Scroll direction should be reported correctly whatever way you scroll
Desktop (please complete the following information):
confirmed for Chrome 95 and Firefox 93
The text was updated successfully, but these errors were encountered: