Skip navigation
Watch out! Chrome has a huge bug with <input type="number"> which causes values to change…
0:00 / 1:20

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

Jake Archibald

@jaffathecake108K followers

Visit on X
950 likesDownloadOriginal post

302,847 views

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.

57 Comments

Comments from the original post on X (Twitter)

  • Jake Archibald's profile picture

    @jaffathecake

    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.

    29 likes

  • Jake Archibald's profile picture

    @jaffathecake

    Some are saying this isn't new… but it is. For a long time, if there's a parent element with a non-passive wheel listener (which React adds by default) then the wheel changes the input value, but it doesn't also scroll the page. The bug I'm talking about is different & new.

    18 likes

  • Jake Archibald's profile picture

    @jaffathecake

    The bug I'm talking about results in the input changing as well as scrolling, making it way more likely that the user doesn't notice the change - as in the video. - the bug appeared in Chrome 147, and was fixed in 150.

    13 likes

  • Jake Archibald's profile picture

    @jaffathecake

    Yesssss @bramus got the fix merged into Chrome 149, which rolls out next week. The bug's still there if you have a passive "wheel" listener on any parent, but hopefully that's less common.

    25 likes

  • Shreyash's profile picture

    @WebDevCaptain

    is this a bug ??? 😅 I thought i just need to focus away and then scroll 😂

    17 likes

  • Jake Archibald's profile picture

    @jaffathecake

    Yes, this doesn't happen in Firefox or Safari. It was a regression in Chrome 147

    15 likes

  • Richard Hyland's profile picture

    @richardhyland

    That bug has been there for years hasn’t it. Swear I’ve seen it for a long time, so long as that input field is focused

    8 likes

  • Jake Archibald's profile picture

    @jaffathecake

    Nah it depends on listeners

    2 likes

  • Steve's profile picture

    @coffeedev

    how is something like this not a hotfix candidate, especially given it's a regression from the previous version 🤯

    2 likes

  • Jake Archibald's profile picture

    @jaffathecake

    I'm pushing for it to be a hotfix. Fingers crossed.

    6 likes

  • James Kemp's profile picture

    @jamesckemp

    I face this issue regularly - it's amplified when you use the Logi Master mouse, because it keeps spinning 🫠

    2 likes

  • Nathan Sherburn's profile picture

    @NathanSherburn

    Thank you for flagging this! We were wondering why people were all of a sudden donating amounts like $1,000.07 at the nonprofit I work at.

    2 likes

  • Jake Archibald's profile picture

    @jaffathecake

    I guess you should put the submit button at the top so people have to scroll up to get to it. Increased donations!

    3 likes

  • rel 3.0's profile picture

    @rellivdev

    I think it's just new feature, scroll driven inputs!

    1 like

  • Eric Fortis's profile picture

    @efortis

    I thought that was a new feature. Now I have to add it back.

    1 like

  • Josh (🦀/acc)'s profile picture

    @joshmo_dev

    @firefox on top babyyyyyyy!!!!

    1 like

  • DO-SAY-GO's profile picture

    @realdosaygo

    Jake, come on, dude, please don't vibe code chrome 😂

    1 like

  • Piotr Chrobak's profile picture

    @pjchrobak

    This behavior isn’t exactly new, is it? Chrome has worked like this for many years. What surprises me more is that this is apparently a regression :)

    1 like

  • Jake Archibald's profile picture

    @jaffathecake

    Some time ago, Chrome would use the scroll wheel for changing values in number inputs, but it wouldn't scroll the page at the same time. All of that is bad UX. The scroll wheel shouldn't change values.

    4 likes

  • Kukka de Bierguirb Häst's profile picture

    @horsemankukka

    @pjchrobak no in a number input field with arrows it's totally the expected behavior imo and i hate programs that don't implement it

    1 like