Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Digit input type #1626

Closed
marcoscaceres opened this issue Aug 4, 2016 · 7 comments
Closed

Digit input type #1626

marcoscaceres opened this issue Aug 4, 2016 · 7 comments
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: forms

Comments

@marcoscaceres
Copy link
Member

On the mailing list, @grimreaper (I think) proposed "digit" as an input type.

There is support for such keyboards on:

It seems like a sensible addition to the platform.

@domenic
Copy link
Member

domenic commented Aug 4, 2016

I feel like we definitely shouldn't add more input types; that hasn't gone super-well in the past. But some kind of revised inputmode proposal that implementers were actually interested in would make sense to me. @mounirlamouri and I have talked about such a thing in the past.

@domenic domenic added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: forms labels Aug 4, 2016
@marcoscaceres
Copy link
Member Author

marcoscaceres commented Aug 4, 2016

I feel like we definitely shouldn't add more input types; that hasn't gone super-well in the past.

Sure, date and color were disasters, but email, url, maybe not so much (at least, on iOS)? But I agree there is scope for something better.

But some kind of revised inputmode proposal that implementers were actually interested in would make sense to me. @mounirlamouri and I have talked about such a thing in the past.

Looking forward to hearing more...

@mounirlamouri
Copy link
Member

The issue with using new type is that developers want to customise them. Advanced types are not used much on the Web and even if one of the reason might be the fairly low browser support for a while, the main reason might be controlling the user experience.

It seems that the main use cases for digit is to control the virtual keyboard and I think something like inputmode would be the right solution. However, I still think that the inputmode spec as it is (or at least, last time I checked) didn't make much sense. I think that exposing various virtual keyboard types like digit in there would be beneficial.

@grimreaper
Copy link
Member

grimreaper commented Aug 5, 2016

I am @grimreaper. I proposed "digit" as an "inputmode", not as a type.
In particular there are a large number of cases where only digits are acceptable, but the type isn't a number per se. For example credit card values, CVV values, TOTP codes, etc.

@grimreaper
Copy link
Member

more generally, being able to control the keyboard presented is a valuable feature, and a large part of the user experience. While I'd love to see advanced types used (and be re-implemented, poorly, less) there is clear evidence that UX designers care about the keyboard.
The present version of how this is done is a "hack" of using the pattern \d*.

@annevk
Copy link
Member

annevk commented Sep 27, 2017

In theory inputmode=numeric addresses this, though note that nobody implements this and we plan on removing it in #3077.

In practice you can use pattern=[0-9]+. We should maybe encourage that user agents adapt their UI based on the attribute value given that they're doing that already?

alice pushed a commit to alice/html that referenced this issue Jan 8, 2019
Move the inputmode attribute definition into the editing section
so that we can declare it in the ContentEditable IDL, and allow it as a
global attribute. Closes whatwg#1897.

Remove the prose concept from inputmode (ie. latin, kana) since it
hasn't been implemented and is not possible to implement in current
virtual keyboard implementations. Closes whatwg#3077, by resolving to do this
subsetting instead of full removal. Similarly closes whatwg#1626 by
establishing inputmode="numeric" as the solution.

Tests: web-platform-tests/wpt#8690
@victornpb
Copy link

Sure, date and color were disasters, but email, url, maybe not so much (at least, on iOS)? But I agree there is scope for something better.

Could you elaborate on what made you come to that conclusion? Why those controls are widely used on native iOS and Android apps, and why it is different on the web.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: forms
Development

No branches or pull requests

6 participants