Closed Bug 1514678 Opened 7 years ago Closed 7 years ago

mousewheel preventDefault doesn't work

Categories

(Firefox :: Untriaged, defect)

64 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: xianshenglu, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36 Steps to reproduce: https://codepen.io/xianshenglu/pen/wRWrdX 1. open the url above in firefox 2. move your mouse into pink area 3. scroll or do the mousewheel things 4. my computer is mac 10.13 Actual results: 1. document scrolls Expected results: 2. document shouldn't scroll Chrome doesn't scroll. Because I have used `event.preventDefault();` in mousewheel event handler.
Thanks for the report. As indicated on MDN, mousewheel is not a standard event, you should use the wheel event instead which is standard and also works on Chrome (just tried with your codepen and replacing the call from onmousewheel to onwheel works): https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onmousewheel Marking as invalid as a consequence.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
However, another problem appears when using onwheel. Scroll bar shows when a wheel button rotates in the pink area while the same thing doesn't happen on Chrome.Do I need to post another bug?
(In reply to xianshenglu from comment #2) > However, another problem appears when using onwheel. Scroll bar shows when a > wheel button rotates in the pink area while the same thing doesn't happen on > Chrome.Do I need to post another bug? Yes please :) Thanks
You need to log in before you can comment on or make changes to this bug.