Nathan Lamont

Notes to Self

Numeric Input on Mobile

I had found a good solution for numeric input on mobile devices but I lost it. It showed screenshots for android and iOS. It was almost perfect.

I found it from one of two sources, one of:

  1. https://news.ycombinator.com/item?id=32852643
  2. https://stackoverflow.com/questions/51660812/best-settings-for-html-input-type-number-for-mobile-devices

OH! I think this was it: https://css-tricks.com/everything-you-ever-wanted-to-know-about-inputmode/, specifically:

<input type="text" inputmode="decimal" />

Update 2023.01.20: another site prompted me to revisit. It appears currently that inputmode="numeric" now does the expected thing on iOS (used to be numbers and a bunch of symbols, now just digits). numeric and decimal are in fact the same, except decimal adds a (subtle) . key.