-
Notifications
You must be signed in to change notification settings - Fork 43
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
Is there a way to disable mouse scroll on input value sliders? #83
Comments
Hi there—Unfortunately there's no built-in way to disable specific pieces of the number controller's functionality. I'd recommend using your fork for now, and we can discuss merging it into the lib if more requests come up. Thanks! |
Just to confirm, when you say focus, you mean "cursor on top of slider", correct? My intent was to make it so you could still scroll wheel by keeping your mouse on the right of the GUI. In the interim, you could either use dipterix's fork, or comment out this line https://github.com/georgealways/lil-gui/blob/master/src/NumberController.js#L386. (edit: Apologies @Ararana—I was conflating users here and thought the PR was yours) |
@Ararana I have a hack for this: // controller is a NumberController
// controller = gui.add(...)
Object.defineProperty(controller, '_hasScrollBar', {
get: function() { return true }
}); In this way you can trick the controller into thinking there is a scrollbar in its parent element, hence the controller scroll effect will go away (tested on the latest lil-gui). The benefit is you don't need to change any source code. The reason why this is a hack is because it changes the prototype of |
Currently if focus is put on a numerical slider, the mouse scroll wheel can be used to change it's value. Can this be disabled?
The text was updated successfully, but these errors were encountered: