Ship inputmode attribute
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox95 | --- | fixed |
People
(Reporter: jwatt, Assigned: m_kato)
References
()
Details
(Keywords: dev-doc-complete, parity-chrome, parity-safari, Whiteboard: [webcompat])
Attachments
(1 file)
+++ This bug was initially created as a clone of Bug #1164402 +++ On mobile devices and tablets it is common for content authors to want the numberic keyboard to be brought up for fields that are not really numbers such as fields for credit card numbers or zip codes. This is causing content authors to use <input type=number> inappropriately. (Inappropriately because these "numbers" are actually strings of digits, not numbers, and may require leading zeros. In the case of a 16 digit credit card numbers only 90% of them can accurately be represented by a double precision floating point number.) We've had the 'inputmode' attribute implemented behind the pref dom.forms.inputmode for more than a couple of years now (see bug 857355). We should push to ship at least inputmode=numeric
Reporter | ||
Updated•9 years ago
|
Reporter | ||
Comment 1•9 years ago
|
||
It seems that the browser on iOS brings up the numeric keyboard for <input type=text pattern="[0-9]*">. That might be a simpler alternative to get shipped to address the credit card and zip code field issues.
Comment 2•9 years ago
|
||
Yes, but for android I remember it doesn't show numeric key pad.
For now spec says, that inputmode should be lowercase https://html.spec.whatwg.org/#the-input-element And it is implemented as lowercase, so i think the whole inputmode should be shipped (not only numeric)
Comment 4•6 years ago
|
||
Chrome reportedly will ship it soon: https://bugs.chromium.org/p/chromium/issues/detail?id=244688
Comment 5•6 years ago
|
||
I see we enable it on nightly already. (works well for me :) )
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Updated•5 years ago
|
Comment 6•5 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Comment 7•5 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Updated•5 years ago
|
Comment 8•4 years ago
|
||
Seems like gov.uk just switched to inputmode=numeric
.
Assignee | ||
Updated•4 years ago
|
Comment 9•4 years ago
|
||
Thanks m_kato for opening those bugs. I think inputmode
is most important on Android, so could we ship it there first, in case Windows or GTK support is more work?
Assignee | ||
Comment 10•4 years ago
|
||
(In reply to Tom Schuster [:evilpie] from comment #9)
Thanks m_kato for opening those bugs. I think
inputmode
is most important on Android, so could we ship it there first, in case Windows or GTK support is more work?
Windows and GTK fix are easy since we already have hint logic for <input type>
. Since this feature already has the preference, if both isn't fixed, we can turn on this for Android only.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 12•3 years ago
|
||
smaug, Although I would like to ship this feature on Desktop, do you have any concerns to enable this? Actually inputmode
has an spec issue such as https://github.com/whatwg/html/issues/4876, but Gecko's behavior is same as WebKit. Changing virtual keyboard layout dynamically causes setting/removing composition string unfortunately.
Comment 13•3 years ago
•
|
||
Does composition string removal happen in other browsers too? Since if not, that might be a blocker I think.
Assignee | ||
Comment 14•3 years ago
•
|
||
Does composition string removal happen in other browsers too? Since if not, that might be a blocker I think.
- Chrome/Windows is that composition string is committed when changing inputmode. No way to keep composition state.
- Chrome/Android depends on current software keyboard. GBoard with English type mode keeps composition string expected, but some IMEs (GBoard with Japanese input mode and PoBOX etc) removes composition string. Others such as GBboard with Korean commits composition string.
- Safari/iOS works with default OS keyboard. But 3rd party software keyboard cannot handle compositing string due to API limitation. So I cannot test on others.
I think that this is the limitation of OS API. If we can support dynamically updating for this attribute, these unexpected behaviors occur like Chrome.
Assignee | ||
Comment 15•3 years ago
|
||
but Gecko's behavior is same as WebKit
That #12's comment was incorrect. comment #14 is the latest test result.
Assignee | ||
Comment 16•3 years ago
|
||
OK, I will try dynamic change support to Gecko since other browsers support it.
Assignee | ||
Comment 17•3 years ago
|
||
Since we have fixed all compatibility bugs and dependencies, so let's
ship this attribute since all browsers already support this.
Updated•3 years ago
|
Comment 18•3 years ago
|
||
Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/6c759f88aed3 Ship inputmode attribute. r=smaug,preferences-reviewers
Comment 19•3 years ago
|
||
bugherder |
Comment 20•3 years ago
|
||
FYI FF95 docs work for this can be tracked in https://github.com/mdn/content/issues/10144#issuecomment-962849650
Updated•3 years ago
|
Description
•