-
-
Notifications
You must be signed in to change notification settings - Fork 576
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
Scrolling is too fast #795
Comments
The value was picked by experimentation, or maybe I took that value from somewhere). I think it was matching windows or Linux behavior. You can disable mousewheel controlling if you return true from the event: $('body').terminal(function(command) {
}, {
mousewheel: () => true
}); Mousewheel was mostly done for |
Hi, thanks for your quick response. Two things:
It would be great if changing the scrolling behavior to be more normal as simple as the code snippet you provided! |
DO you only have a TypeScript error or the code doesn't work at all? TS errors are like warnings they still generate the output code so you can test if it works. I will add typing for the mousewheel event. |
I just tried it again: I have the TypeScript error, but the code does work as you said. I previously thought the code did not work, but I think I was editing the wrong copy of the file on my computer. Thank you! Also, I suggest adding |
Yes, not everything is properly documented. There are a lot of issues for writing the documentation. I need to take some time just go through everything in the code and properly document it. |
Issue summary
Scrolling with the touchpad or a mouse wheel is too fast. This makes it difficult to scroll a specific part of the history. I'm using a Mac, and this happens with both the touchpad and with a mouse scroll wheel, in Chrome, Firefox, and Safari.
This can be tested by going to https://jcubic.github.io/jquery.terminal/, holding down Enter until there are enough lines of output that a scrollbar appears, and then scrolling. The minimum scrolling increment for me is about 2 whole lines. In "normal" web content with a similar font size, the minimum scrolling increment is about 0.1-0.2 lines.
I found that replacing this:
jquery.terminal/js/jquery.terminal.js
Lines 12057 to 12061 in a2d769d
with this:
results in natural-feeling scrolling behavior, with proper acceleration.
Is there a particular reason that scrolling code sets the scrolling increment to 40?
The text was updated successfully, but these errors were encountered: