whatwg / html

HTML Standard
https://html.spec.whatwg.org/multipage/
Other
8.02k stars 2.62k forks source link

Add an `inputmode` to show the "Numbers and Punctuation" view switchable to the alphabetical view #3478

Open Yaffle opened 6 years ago

Yaffle commented 6 years ago

Hello,

Is there any chance to see an inputmode to show the virtual keyboard which allows to input any character while showing the "Numbers and Punctuation" view by default? (what Chrome on Android does after a pressing of "?123" and iOS Safari does aswell according to the Internet)

My use case is "AsciiMath" fraction (1/2), other characters are needed too. While most of the time users will input digits.

Thank you for working on this!

P.S. I'm not very good at spec reading - I didn't catch at first, that inputmode MAY trigger a virtual keyboard which allows to input only a limited set of characters.

annevk commented 6 years ago

@dtapuska I think that's the intent, right? It's not a restriction on input, it's just an input hint.

dtapuska commented 6 years ago

Yes that is the intent. The problem is this keyboard exposed in the input connection enums on Android. (see https://developer.android.com/training/keyboard-input/style.html) As it might be a state the the keyboard enters but doesn't necessarily present as a initial state.

Yaffle commented 5 years ago

The decimal inputmode does n't provide ability to input the minus sign / hyphen-minus on some Android mobile phones, seems.

Yaffle commented 4 years ago

WebKit was changed to show "PIN entry pad" - https://bugs.webkit.org/show_bug.cgi?id=197916 ...

The previous behavior was perfect, seems (I didn't test), for my use case.

myakura commented 4 years ago

Yes that is the intent. The problem is this keyboard exposed in the input connection enums on Android.

Ouch. Such tying-to-a-particular-layout implementation is problematic. WebKit changed their virtual keyboard layout for the numeric inputmode in iOS13 dropping punctuation [1]. And it broke some web version of Microsoft PowerApps apps [2].

Since both stock keyboard on iOS and Android tie particular layout to a particular inputmode, perhaps the spec should ① specify minimum set of characters to be shown for each mode, ② or give an advice (or a warning) that user might not be able to input some characters that authors assume 😕?

[1] https://bugs.webkit.org/show_bug.cgi?id=197916 [2] https://powerusers.microsoft.com/t5/Building-Power-Apps/iOS-13-public-beta-numeric-keypad-missing-decimal-point/td-p/315631