-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
inputmode
or other hint to trigger "time" input method
#4307
Comments
As an aside, if it's more likely to succeed, I'd be happy to open an issue to request more control over the presentation of |
cc @dtapuska |
From my understanding this is about overriding the user preference of how to input a time? By default the time element uses the user's locale settings to determine if it should present a 24 hour or 12 hour clock. And it appears you always want to present a 24 hour clock is that correct? That doesn't mean that the user will understand what you want them to enter if they don't understand 24 hour notation. On Android Chrome already prompts with the graphical system time picker. So I'm not certain there is anything really to do there. |
Sorry if I was unclear. While I would appreciate what you describe -- a Instead, in this issue, I'm asking for a property to set on The requirement that I have been given for the application I'm writing is to always show times in 24-hour format. The customer is military and they work exclusively with a 24-hour clock, regardless of how civilians in the area would localize time. Changing the platform locale is not an option (nobody offers a locale for "en-us, but with 24-hour time") so I'm following the advice I linked to above, and using |
I think if we added |
I hadn't thought of that. I'm aware that, for example, some Android versions will pop up a "clock" interface to pick times, and might give two rings of numbers in a 24-hour locale (0-11 on the outside, 12-23 on the inside) versus a single ring for a 12-hour locale, with the option to tap "AM/PM" to toggle. I was really hoping to trigger a num-pad input with (at least) period and colon characters, since those are the commonly-used separators in this context. Maybe letting the user input a time with a 12-hour picker is still better than giving them an alpha keyboard, or a numpad without the colon character? Would I be better served opening a separate suggestion to allow customization of presentation / locale on |
I'm not sure, you might also wanna review the discussion in #4180. In general implementers are somewhat lukewarm to invest here until there's a clear proven need and a way to implement the control in terms of some preexisting primitives. |
Thanks for the link, #4180 clarifies a bit. Would it be better for me to close this issue and open a new one with a problem statement rather than a solution? I had not seen the FAQ, so I assumed that open ended issues that just say "My use case is X, and I think the current spec does not support it well" are too close to "Help, how do I do X?" -- which is of course a post best made to StackOverflow, not this tracker. If I open a new issue, I would state the problem like this: My use case is a military application, where users express time using a 24-hour clock, regardless of normal regional preferences. The requirement is for a form input:
Is that detailed enough to start a discussion? Is it too close to requirements that have been considered and denied previously? |
This is a feature request to support a
time
value forinputmode
.I'll say up front, what I actually want is a time-only input where I have control over presentation format. This (slightly older) question suggests using
<input type=text>
with a custompattern
, but my issue is that this won't trigger an appropriate input method. This means that I can use<input type=time>
but have limited control over what the user sees, or I can use<input type=text pattern="...">
and (presumably) the user gets a generic text keyboard to work with. If there's a solution for the first problem -- how to format the presentation oftype=time
-- I'd be happy to hear it, but I won't hold my breath.That's why I'm opening this issue to address the second problem. As I understand it,
inputmode
exists to address needs like this. On mobile, this might present a clock-face input, or at least a number pad with period and/or colon characters as separator. I believe we need a new value, because whilenumeric
ordecimal
could almost work, in many locales the colon is critical, but missing from the available inputs for both those cases.Also: I found #3077, but it sounds like the end result was that
inputmode
will stick around. I also saw some remarks about not adding newinputmode
values, but that was some time ago so I'm not sure if this stance has changed -- #3478 still hasn't been closed. So if you're still considering other candidates forinputmode
, I'd like to seetime
as an option.The text was updated successfully, but these errors were encountered: