Closed Bug 1205133 Opened 9 years ago Closed 3 years ago

Ship inputmode attribute

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

37 Branch
enhancement

Tracking

()

RESOLVED FIXED
95 Branch
Webcompat Priority revisit
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
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.
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)
I see we enable it on nightly already. (works well for me :) )
Priority: -- → P3
Keywords: parity-chrome
Whiteboard: [webcompat]
See Also: → 1425291
Depends on: 1509527
Type: defect → enhancement

Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.

Webcompat Priority: --- → ?

See bug 1547409. Migrating whiteboard priority tags to program flags.

Webcompat Priority: ? → revisit

Seems like gov.uk just switched to inputmode=numeric.

Depends on: 1424284
Depends on: 1618754
Depends on: 1618759
Depends on: 1618763

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?

(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.

Summary: Ship inputmode=numeric → Ship inputmode attibute
Summary: Ship inputmode attibute → Ship inputmode attribute
Keywords: parity-safari
Keywords: dev-doc-needed
Depends on: 1630645
Depends on: 1631681

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.

Flags: needinfo?(bugs)

Does composition string removal happen in other browsers too? Since if not, that might be a blocker I think.

Flags: needinfo?(bugs)

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.

but Gecko's behavior is same as WebKit

That #12's comment was incorrect. comment #14 is the latest test result.

OK, I will try dynamic change support to Gecko since other browsers support it.

Depends on: 1697333
Depends on: 1729402
QA Whiteboard: qa-not-actionable

Since we have fixed all compatibility bugs and dependencies, so let's
ship this attribute since all browsers already support this.

Assignee: nobody → m_kato
Status: NEW → ASSIGNED
Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/6c759f88aed3
Ship inputmode attribute. r=smaug,preferences-reviewers
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch

FYI FF95 docs work for this can be tracked in https://github.com/mdn/content/issues/10144#issuecomment-962849650

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: