3 ms·
Input type="number" is the only way to get a numeric keyboard that supports floating point numbers on iOS. The "pattern" trick gives you nice big numbers, but n
by dorkwood 8y ago
Input type="number" is the only way to get a numeric keyboard that supports floating point numbers on iOS. The "pattern" trick gives you nice big numbers, but no decimal point. Apparently, the "inputmode" property will solve this in the future, but it doesn't yet.
I learnt this the hard way while trying to get my text input fields to show the correct numeric keyboard on this site: https://percentagecalculatortools.com https://percentagecalculatortools.com -- I eventually had to switch back to number inputs. I couldn't find any other solution that worked.
- jarfil 8y agoOn the bright side, it's probably less likely to have an input impacted by a mouse wheel on mobile, so just changing the input type between mobile and desktop might be good enough.