5 ms·
> However the inputmode attribute is now supported by all the mobile browsers we test in. This isn't extensive, which might be a tad misleading if you don't do
by shakna 7y ago
> However the inputmode attribute is now supported by all the mobile browsers we test in.
This isn't extensive, which might be a tad misleading if you don't double check. They test on Chrome & Samsung for Android, and iOS is only the one engine.
And those three browsers seem to be the only mobile browsers that have implemented it. (Well, Opera Mobile as well). [0]
Desktop support is also extremely spotty.
This seems like it might be leaping the gun on expecting this standard to pick up the slack.
Whilst they might feel the support is there for their particular audience after 2019, I wouldn't, and would suggest that you need to check your particular audience closely before following this advice for your own site. (Which is fairly generic advice, but appropriate.)
[0] https://caniuse.com/#feat=input-inputmode https://caniuse.com/#feat=input-inputmode
- chrisweekly 7y agoDesktop support is also almost moot, though, right? What's the "desktop with virtual keyboard" use case?
- oldmanhorton 7y agoTouchscreen pcs? Surface Pro users in particular would see this.
- alkonaut 7y agoThe fallback is a regular touch keyboard with both letters and digits. On a screen larger than a phone I think I’d prefer that to a numeric pad.
- joelanman 7y agoThe article covers quite a few issues with type=number, including some pretty bad accessibility ones. On balance I think even if inputmode doesn't have 100% support, those users will simply get a normal keyboard, which isn't so bad. Disclaimer - I work on the team.
- vidarh 7y agoYeah, for my current work app we've just unceremoniously dropped type=number for most things, without inputmode or anything, and the experience is overall so much better even then.
- samatman 7y agoI wish you'd use inputmode. I find it vaguely unsatisfying when I'm asked to input a pure string of digits using a full keyboard on mobile. It feels half-baked, and my estimation of the quality of the software goes down.
- signalsmith 7y agoIn this case, the fallback is still a plain-text field, into which the user should enter numbers. Perfectly usable, but without the keyboard hint, so it seems like a graceful fallback to me.
- SifJar 7y ago> Desktop support is also extremely spotty. Arguably it's less important there if one of the main motivations is that on mobile browsers will display a numeric keypad instead of full keyboard (which is my impression from skimming the article)
- opless 7y agoAs long as they validate their inputs!
- emayljames 7y agoThere needs to be a website to see if you can use caniuse website on your mobile browser. The site is unusable on mobile Firefox. The irony.
- chias 7y agoTrying this out in the latest Desktop Firefox, the numberinput and pattern attributes seem to have no effect, and it behaved exactly like a regular type="text" input.
- alkonaut 7y agoThe pattern is only a trick to persuade old iOS Safari to show the numeric pad even though it’s “text”.
- daveoc64 7y agoYes. The lack of support for this in Firefox for Android makes using many forms disappointing. Interestingly I see that https://vehicletax.service.gov.uk/ https://vehicletax.service.gov.uk/ uses type="tel", so I am getting a numeric keyboard in Firefox.