3 ms·
The right choice is `inputmode`, which says how to input the value without specifying semantics. https://html.spec.whatwg.org/multipage/interaction.html#input-
by kibibu 8y ago
The right choice is `inputmode`, which says how to input the value without specifying semantics.
https://html.spec.whatwg.org/multipage/interaction.html#input-modalities%3A-the-inputmode-attribute https://html.spec.whatwg.org/multipage/interaction.html#inpu...
It'll work in Chrome (and other Blink-based browsers), but nothing else.
- dpwm 8y ago> It'll work in Chrome (and other Blink-based browsers), but nothing else. What's interesting is it used to be partially supported in Firefox, and has now been put behind about:config [0]. I'm curious as to why, since the MDN docs seems to endorse its use. [1] [0] https://caniuse.com/#search=inputmode https://caniuse.com/#search=inputmode [1] https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode https://developer.mozilla.org/en-US/docs/Web/HTML/Global_att...
- efraim 8y ago> It'll work in Chrome (and other Blink-based browsers), but nothing else. Then it isn't the right choice.
- TurningCanadian 8y agoIt's a progressive enhancement. It doesn't break other browsers.
- ceejayoz 8y agoIf the widely supported <input type="tel"> or <input type="phone"> offer a better user experience on average for your users, it's not an enhancement at all. Not yet, at least.
- benatkin 8y agoI just took a close look at the caniuse page [1]. It says that inputmode also works in Mobile Safari on iOS 12.2, which is at Beta 6 [2]. Firefox's mobile market share is 0.58%, and the market share for old versions of Mobile Safari is at 2.51% according to the caniuse page so it's probably not worth waiting on Firefox. I think it will be a good choice very soon, maybe in a couple of months, because it's still possible to enter numbers with the regular keyboard. 1: https://caniuse.com/#search=inputmode https://caniuse.com/#search=inputmode 2: https://en.wikipedia.org/wiki/IOS https://en.wikipedia.org/wiki/IOS (Latest preview in the infobox)
- Cthulhu_ 8y agoNor is input type="number", given how each OS will offer a different on screen keyboard.