jQWidgets Forums

jQuery UI Widgets Forums Editors NumberInput Deactivate Spinning on mousewheel

This topic contains 5 replies, has 5 voices, and was last updated by  kaos057 10 years, 6 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Deactivate Spinning on mousewheel #46573

    Klaus H
    Participant

    Hello,

    can I deactivate the spin behaviour of the number input by using the mousewheel? I have tried to set the spinmode on simple, but that did not change it.

    Kind regards
    Klaus

    Deactivate Spinning on mousewheel #46574

    Peter Stoev
    Keymaster

    Hi Klaus,

    There is currently no option to deactivate it.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Deactivate Spinning on mousewheel #46575

    Klaus H
    Participant

    Hello Peter,

    okay, thanks. I think that would be useful though, if you use the mouse wheel to scroll down on a page you can change numbers by accident.

    Regards
    Klaus

    Deactivate Spinning on mousewheel #47171

    Damien
    Participant

    Hi Klaus,

    We had that problem too, users kept accidentally changing values when scrolling up and down using the mouse wheel. A big problem when the numbers concerned are money!

    I found the following solution to work, just add this line right after creating the numeric control:

    $.jqx._jqxNumberInput.prototype.wheel = function () { return false; };

    It’s probably not technically perfect, but it works,

    Cheers

    Damien

    Deactivate Spinning on mousewheel #48703

    Marc
    Participant

    Thanks Damien for the tip. I think we will use that for the DateTimeInput. This issue is particularly bad when the widget is inside a scrollable panel since both the panel and the input respond to the widget. It appears that the input only receives the mousewheel event when it has focus and the wheel is scrolled while the cursor is over the input. Since the scroll event also moves the panel so that the cursor is no longer over the input field, the input value changes by one and then subsequent scroll events are not seen.

    Conversely, if the user is scrolling the panel using the mouse wheel and happens to have the cursor over an input which has focus then the value may be inadvertently changed.

    Deactivate Spinning on mousewheel #59489

    kaos057
    Participant

    Apparently this was added at some point and never added to documentaion. enableMouseWheel (true by default). set to false disables the mousewheel fine. Just wanted to point that out 🙂

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.