Watch out! Chrome has a huge bug with <input type="number"> which causes values to change unexpectedly.

It's fixed in Chrome 150, but that won't land until the end of June.

The 'fixed' behaviour in Chrome 150 is screwy too:

Default: mouse wheel doesn't change the input value. Allows scrolling.

If there's a non-passive 'wheel' listener on any parent: wheel does change the value. Prevents scrolling.

If there's a passive listener: The bug returns.

@jaffathecake kinda feels like maybe the only correct solution here is if the pointer is physically over the input, it changes the value and prevents scrolling. If it's outside the input it scrolls and doesn't change the value. Whatever else they're doing is going to be way too fragile.
@Lukew eh I think overloading the wheel for this is bad UX. I guess if the rest of the OS does it, then maybe copy that bad UX for the sake of consistency, but it isn't a convention on MacOS.
@jaffathecake oh yeah I mean getting rid of scroll changing value would also be fine by me. I was more thinking that assuming that was a constraint you wanted to keep in some way.
@jaffathecake https://github.com/whatwg/html/issues/10911 - related discussion. It seems this behaviour may have changed over time so perhaps we should just get rid of it.
Specify the ability to scroll to increase/decrease <input type=number> · Issue #10911 · whatwg/html

What is the issue with the HTML Standard? Both Chrome and Safari support increasing or decreasing the value of <input type=number> by scrolling the mouse wheel only when input element need to be fo...

GitHub
@Lukew yeah, Firefox and Safari don't do it.