Create a property to enable or disable mouse wheel support on numeric textbox (#881)
The feature created in #881 is very good, but in some cases it doesn't help the use of the page, só it would be nice to have the option to disable this feature.
10 comments
serge
Posted on:13 Mar 2022 20:05
changeValueOnScroll that is the solution, thanks for this update!
ADMIN
Dimiter Topalov
Posted on:11 Mar 2022 08:43
Hello Serge,
The example still seems to be working as expected with the latest versions of our packages:
However, as this feature request is completed, and now there is a built-in option for stopping changing the value on scroll, we recommend using the said option:
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
serge
Posted on:10 Mar 2022 16:28
The solution proposed by Svet on 10 Aug 2021 17:42 does not work, as described here
serge
Posted on:10 Mar 2022 16:26
The solution proposed by Svet on: 3 Apr 2020 11:44 does not work, the scroll when the mouse pointer is in the textbox area does change the value of the textbox
ADMIN
Svet
Posted on:10 Aug 2021 15:42
Hi Mike,
I checked the suggested example by Dimiter. Running it I see that the value of the NumericTextBox isn't changed when the default behavior of the wheel event is prevented. Also if the page has a scrollbar and the wheel default behavior is prevented for the NumericTextBox, then using the wheel does scroll the page. Please find an updated example at the following link:
In case further assistance is required for this case please open a separate private support thread so that we can continue the discussion with any further details. Thanks.
The workarounds provided are not sufficient for my use case as I still want the scroll event to scroll the page. I just do not want the numeric textbox to change value. Are there any alternative solutions to disable this?
mike
Posted on:04 Aug 2021 18:54
Dimiter, the example you provided does not stop the wheel from changing the value. Is there an update to this?
ADMIN
Dimiter Topalov
Posted on:12 Mar 2021 11:46
Hello Diego,
Thank you for sharing this solution. Another more generic one that comes to mind is to create a custom directive which takes a boolean input indicating whether the wheel event should be stopped. To apply the directive to all NumericTextBox components automatically, it may have the same selector.
Here is a sample implementation of the described approach:
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Diego
Posted on:09 Mar 2021 11:18
Waiting for official support....i attach a more precise and angular style workaround to use on single components using numeric textbox:
// TODO: wait for https://feedback.telerik.com/kendo-angular-ui/1459512-create-a-property-to-enable-or-disable-mouse-wheel-support-on-numeric-textbox-881
We will track the demand for this feature and plan accordingly our future development plans.
What could be done as a workaround until the feature is released is to use some custom JavaScript in order to handle the generic (wheel) event of the input element used by the NumericTextBox and stop its propagation. Please check the following example demonstrating such approach:
Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic. Our thoughts here at Progress are with those affected by the outbreak.