Closed Bug 949989 Opened 11 years ago Closed 3 years ago

Make <input type=number> respond to the mouse wheel

Categories

(Core :: DOM: Forms, defect, P5)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1261673

People

(Reporter: jwatt, Unassigned)

References

(Blocks 1 open bug)

Details

We should make <input type=number> respond to the mouse wheel.
Could you elaborate? do you mean it'll respond by changing the value when hovering
over it and mouse-wheel scrolling? or only when it has focus? or something else?
One of the two. I don't have a strong opinion of whether it should need to be focused or not. Will check other implementations in January.
I'm not sure it's a good idea to change the value for any kind of
mouse-wheel action, for the same reason as we don't do that for
<select>.  It's just too easy to accidentally change the value
when you intend to scroll the page.
I agree with Mats. At least, only while <input> should have focus, it should handle wheel events. If <input> would handle wheel events during hovering, ESM needs to handle it with mouse wheel transaction system. It makes the implementation more complicated.
https://wiki.mozilla.org/Gecko:Mouse_Wheel_Scrolling#Mouse_wheel_transaction
I filed this because someone requested this feature (and I believe Chrome also implements this). I don't plan to work on it in the foreseeable future though since I have too many other things on my plate.
The duplicate I just marked had attachment 8440374 [details], which may or may not help when implementing this (I imagine the handlers will need to be redone in C++, but there we are...)
My reasoning in the duplicate was like this: I expect this because system number inputs on Windows and Linux respond to mouse wheel by changing value. 

Regarding occasional change when you want to scroll the page instead, my example code only changes value when the input is focused and the pointer is over the input.
Priority: -- → P5
See Also: → 1327816
Component: DOM: Core & HTML → DOM: Forms

This is fixed in:

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.