# 'Prevent Default' has no effect on the 'onWheel' event

**URL:** <https://forum.inductiveautomation.com/t/prevent-default-has-no-effect-on-the-onwheel-event/96414>\
**Category:** Ignition\
**Tags:** perspective, ignition81, scripting\
**Created:** [September 25, 2024, 9:56am UTC](https://forum.inductiveautomation.com/t/prevent-default-has-no-effect-on-the-onwheel-event/96414 "2024-09-25T09:56:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![VinceV](https://avatars.discourse-cdn.com/v4/letter/v/bb73d2/32.png) [@VinceV](https://forum.inductiveautomation.com/u/VinceV)\
**Post date:** [September 25, 2024, 9:56am UTC](https://forum.inductiveautomation.com/t/prevent-default-has-no-effect-on-the-onwheel-event/96414/1 "2024-09-25T09:56:46Z")

</div>

Hi there, I'm trying to implement zooming with mousewheel on a component. This works fine, except for the fact that the whole page scrolls with it. The "prevent default" option ought to disable that behavior, but that option does not work for this event.

```txt
Calling 'preventDefault()' on a 'wheel' event from a listener registered as 'passive' was ignored. react-dom-18.2.0.js:51:314

```

Is there some way to work around this?

---

<div class="post-metadata">

**Author:** ![Chris\_Murphy](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@Chris\_Murphy](https://forum.inductiveautomation.com/u/Chris_Murphy)\
**Post date:** [May 15, 2025, 3:44am UTC](https://forum.inductiveautomation.com/t/prevent-default-has-no-effect-on-the-onwheel-event/96414/2 "2025-05-15T03:44:36Z")

</div>

I don't know why you didn't get a response. This is an annoying issue.

I've just come across this trying to prevent the numeric input field from incrementing/decrementing on mouse wheel event.

The problem is that the event is added as passive by default and passive events can't prevent default.

If the user sets the "Prevent Default" option in the event dialogue, the event handler should be added with the third parameter as { passive: false }

The same is true for touch start and touch move.

This is a bug IMO.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 15, 2025, 11:27am UTC](https://forum.inductiveautomation.com/t/prevent-default-has-no-effect-on-the-onwheel-event/96414/3 "2025-05-15T11:27:00Z")

</div>

Have either of you opened a support ticket to report this bug? IA doesn't dedicate eyes over here to do that for bug reports.
